The difference between concurrent mutex parallel synchronous asynchronous multithreading
concurrency : In the operating system, there are several programs in a period of time that are running from the start to running, and these programs are running on the same processor. Two of these concurrency relationships are synchronous and mutex, respectively
Mutex: The use of critical resources between processes is called mutual exclusion. Critical resource (Critical Resource): A resource that can be used only by one process at a time. Such as: Hardware has a printer, software has variables, disk files (when writing). Critical Zone (critical section): The code that accesses the critical resource in the process becomes the critical section. In order to achieve mutually exclusive access to the critical resource, the mutually exclusive access of the process to the critical resource can be realized as long as the process is mutually exclusive to its own critical section.
Synchronization: The relationship between processes is not the relationship of mutually exclusive critical resources, but the interdependent relationship. Further note: The output of the previous process is the input of the latter process, and the second process must wait when the first process does not output. A group of concurrent processes that have synchronization relationships send each other information called messages or events. There is concurrent pseudo concurrency and true concurrency, pseudo-concurrency refers to the single-core processor concurrency, true concurrency refers to the multi-core processor concurrency.
Parallel: In a single processor multi-channel program design system, the process is alternately executed, showing a concurrency of external special; In multiprocessor systems, processes can be executed alternately, and can overlap. A program on a multiprocessor can implement parallel processing. In this sense, parallelism is for multi-processor. Parallel is a concurrent occurrence of multiple simultaneous events, with the meaning of concurrency, but concurrency is not necessarily parallel, it is also said that concurrent events do not necessarily occur at the same time.
Multithreading: Multithreading is the logical layer concept of programming, which is a piece of code that runs concurrently in a process. Multithreading enables switching between threads to execute.
Async: asynchronous and synchronous are relative , synchronization is sequential execution , execution of one after execution of the next, need to wait, coordinated operation. asynchronous is independent of each other, in the process of waiting for an event to continue to do their own things, do not have to wait for the event to complete and then work . a thread is a way to implement Asynchrony . Async is the main thread that lets the calling method do not need to wait for another thread to finish synchronously, so that the main thread can Cheng Gan other things. Async and multithreading are not an equal relationship, asynchronous is the ultimate goal, multithreading is just a means for us to implement Asynchrony . Asynchronous is when a call request is sent to the callee, and the caller can do something else without waiting for the return of the result. The implementation of Asynchrony can be handled by multithreading or by handing it to another process.
The difference between concurrent mutex parallel synchronous asynchronous multithreading