Asynchronous vs Multithreading – Is there a difference?

Whenever the operation that needs to happen asynchronously does not require the CPU to do work, that operation can be done without spawning another thread. For example, if the async operation is I/O, the CPU does not have to wait for the I/O to complete. It just needs to start the operation, and can then move on to other work while the I/O hardware (disk controller, network interface, etc.) does the I/O work. The hardware lets the CPU know when it’s finished by interrupting the CPU, and the OS then delivers the event to your application.

Frequently higher-level abstractions and APIs don’t expose the underlying asynchronous API’s available from the OS and the underlying hardware. In those cases it’s usually easier to create threads to do asynchronous operations, even if the spawned thread is just waiting on an I/O operation.

If the asynchronous operation requires the CPU to do work, then generally that operation has to happen in another thread in order for it to be truly asynchronous. Even then, it will really only be asynchronous if there is more than one execution unit.

Leave a Comment