The implementation of asio for a particular platform may make use of one or more additional threads to emulate asynchronicity. As far as possible, these threads must be invisible to the library user. In particular, the threads:
must not call the user's code directly.
must block all signals.
This approach is complemented by the following guarantee:
Asynchronous completion handlers will only be called from threads that are currently calling asio::io_service::run().
Consequently, it is the library user's responsibility to create and manage all threads to which the notifications will be delivered.
By only calling asio::io_service::run() from a single thread, the user's code can be avoid the development complexity associated with synchronisation. For example, a library user can implement scalable servers that are single-threaded (from the user's point of view).
A library user may need to perform initialisation in a thread shortly after the thread starts and before any other application code is executed. For example, users of Microsoft's COM must call CoInitializeEx before any other COM operations can be called from that thread.