2016-06-27 Concurrent Programming

Source: Internet
Author: User

Excerpt from an in-depth understanding of operating system CHA 12

Concurrency is overlapping on logical control flows. Application-level concurrency is useful in the following situations:

1 access to slow I/O devices.

2 Interacting with people

3 Reduce latency by postponing work

4 Serving multiple network clients

5 concurrent operations on multicore machines

Applications that use application-level concurrency are called concurrent programs. The modern operating system provides 3 basic ways to construct concurrent programs:

1 Process: This method, each logical control flow is a process that is dispatched and maintained by the kernel. The process has its own virtual address space, and to communicate with other streams, the control flow must use the IPC (interprocess communication) mechanism. IPC mechanisms are: pipelines, shared memory, queues, semaphores

2 I/O multiplexing: In this concurrent programming, the application explicitly dispatches their own logical flow in the context of a process. The logical stream is transformed into a state machine, and after the data arrives at the file descriptor, the main program explicitly transitions from one state to another state. Because the program is a separate process, all streams share the same address space.

3 Threads: Threads are logical streams that run in a single process context and are dispatched by the kernel. Threads can be thought of as a mixture of other 2. is dispatched by the kernel like a process flow, and shares a virtual address space like an I/O multiplexed stream.

2016-06-27 Concurrent Programming

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.