Concurrent, parallel, synchronous, asynchronous, blocking, non-blocking concept finishing

1. Parallel and Concurrent

Concurrency : it refers to a time period within, a plurality of programs run on the CPU, but any time only one program running on the CPU ;

    A period of time to complete the switch between programs, it is for example within 1s, the program 100 is executed,

Parallel : it refers to an arbitrary point in time on a plurality of programs are running on the CPU;

    For example, we have four of the CPU core, the maximum carrying capacity of the program at a time point of 4

 

So we usually say high concurrency, but few have heard too high parallel, precisely because of the limited number of our core CPU, the following give an example to illustrate the difference between the two: the situation is not water, to wash kettle, teapot cup to wash; the fire had tea has also been how to do?

  Concurrent Version : wash bottle, filled with cold water and boil, then use the time to boil water to wash the teapot is completed, wash the cup, put tea, etc., and finally tea to drink;

  Parallel version: A wash bottle, filled with cold water, and boil water; B Wash teapot; C wash cup, put tea; (A, B, C, D represent a person)

 

2. synchronous and asynchronous

  Sync: refers to the code calls IO operations when the need to wait until the IO operation is complete run mode only after the return;

  Asynchronous : refers to the code calls the IO operation time, you do not need to wait until the IO operation mode of operation only after the completion of the return

 

3. blocking and non-blocking

  Obstruction : it refers to the calling function when the current thread is suspended ;

  Non-blocking : it refers to the calling function when the current thread is not suspended, but returned immediately ;

Guess you like

Origin www.cnblogs.com/kisun168/p/11210455.html
Recommended