Introduction
The use of asynchronous code has become more popular as programmers seek ways to deal with latency and blocking operations in their applications. For example, an application running with the benefit of significant local resources is still at the mercy of the response time of other systems that it has to communicate with. In many cases, applications wait for their users to respond, and they shouldn't consume all available system resources while they wait for the users to react.
To deal with these and similar challenges, multithreaded code has been used. With this approach, the work that needs to be done is handled by multiple threads, so while one thread is handling network communication, another may update the display. Sometimes, this approach has its own limitations, as additional threads increase complexity for the programmer, and there are practical limitations on how many threads can be effectively created and utilized.
Whether your code is currently multithreaded or...