Is asynchronous use of multithreading or parallelism required?

Or we have asynchronous code that runs on the same thread.

+3
source share
3 answers

Actually, yes, you can have asynchronous code that runs on the same thread. Most basic IOs these days are actually asynchronous; reading and writing are requested and processed outside the CPU when they are complete, a flag is set, and then the program can address the values. The program does this by periodically checking the value of the flag during its normal processing and response when the value indicates availability. The operating system will usually coordinate this for higher-level programs.

, . :

http://en.wikipedia.org/wiki/Asynchronous_I/O

+4

, , . - , select non-blocking IO , "" . , , .

- , , , .

+2

Async - JavaScript (, , -), JavaScript .

0

Source: https://habr.com/ru/post/1772869/


All Articles