Thread (concurrent mutex synchronization parallel multithreading asynchronous), mutex Multithreading

Source: Internet
Author: User

Thread (concurrent mutex synchronization parallel multithreading asynchronous), mutex Multithreading

1. Concurrency: in the operating system, several programs in a period of time are between started and running, and these programs are all running on the same processing machine. The two types of concurrency are synchronization and mutex.


2. Mutual Exclusion: the use of critical resources between processes is called mutual exclusion.


3. Synchronization: the relationship between processes is not the relationship between mutually exclusive critical resources, but the relationship between them. Further description: the output of the previous process is used as the input of the next process. When the first process has no output, the second process must wait. Messages or events are sent by a group of concurrent processes with synchronization relationships.
Concurrency includes both pseudo concurrency and real concurrency. pseudo concurrency refers to the concurrency of a Single-core processor, and real concurrency refers to the concurrency of a multi-core processor.


4. parallel: in a single-processor multi-channel program design system, processes are executed alternately, showing a concurrent external special feature. In a multi-processor system, processes can not only be executed alternately, in addition, it can overlap execution. A program on a multi-processor can implement parallel processing. We can see that parallelism is for multi-processor. Parallel is a concurrent event that occurs at the same time and has the meaning of concurrency, but concurrency is not necessarily parallel. It also means that concurrent events do not necessarily occur at the same time.

5. multithreading: multithreading is the logic layer concept of programming. It is a piece of code that runs concurrently in a process. Multiple Threads can switch between threads.

6. asynchronous: asynchronous and synchronous are opposite. synchronous means sequential execution. After one execution is complete and then the next execution is executed, it is necessary to wait and coordinate the operation. Asynchronization is independent of each other. You do not need to wait for the event to complete before proceeding. Threads are asynchronous. Asynchronous means that the main thread that calls the method does not need to wait for the completion of another thread synchronously, so that the main thread can do other things.
Asynchronization is not the same as multithreading. Asynchronization is the ultimate goal. multithreading is just a means for us to implement Asynchronization. Asynchronous means that when a call request is sent to the called user, the caller can do other things without waiting for the return of the result. To implement Asynchronization, you can use multithreading technology or hand it over to another process for processing.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.