Why are Asynchronous processes not called Synchronous?

前端 未结 9 2142
我寻月下人不归
我寻月下人不归 2020-12-28 14:46

So I\'m a little confused by this terminology.

Everyone refers to \"Asynchronous\" computing as running different processes on seperate threads, which gives the illu

9条回答
  •  不思量自难忘°
    2020-12-28 15:29

    I think there's a slant that is slightly different to most of the answers here.

    Asynchronous means "not happening at the same time".

    In the specific case of threading:

    • Synchronous means "execute this code now".
    • Asynchronous means "enqueue this work on a different thread that will be executed at some indeterminate time in the future"

    This usually allows you to "do two things at once" because of reasons like:

    • one thread is just waiting (e.g. for data to arrive on a serial port) so is asleep
    • You have multiple processors, so the two threads can run concurrently.

    However, even with 128 processor cores, the case is the same: the work will be executed "at some time in the future" (if perhaps the very near future) rather than "now".

提交回复
热议问题