asio 0.3.8rc3 Home | Reference | Tutorial | Examples | Design
Design

Platform-Specific Implementation

This design note lists platform-specific implementation details, such as the default demultiplexing mechanism, the number of threads created internally, and when threads are created.

Linux Kernel 2.4

Demultiplexing Mechanism

Uses select for demultiplexing. This means that the number of file descriptors in the process cannot be permitted to exceed FD_SETSIZE.

Threads

Demultiplexing using select is performed in one of the threads that calls asio::io_service::run().

An additional thread per io_service is used to emulate asynchronous host resolution. This thread is created on the first call to either asio::ip::tcp::resolver::async_resolve() or asio::ip::udp::resolver::async_resolve().

Linux Kernel 2.6

Demultiplexing Mechanism

Uses epoll for demultiplexing.

Threads

Demultiplexing using epoll is performed in one of the threads that calls asio::io_service::run().

An additional thread per io_service is used to emulate asynchronous host resolution. This thread is created on the first call to either asio::ip::tcp::resolver::async_resolve() or asio::ip::udp::resolver::async_resolve().

Solaris

Demultiplexing Mechanism

Uses select for demultiplexing. This means that the number of file descriptors in the process cannot be permitted to exceed FD_SETSIZE.

Threads

Demultiplexing using select is performed in one of the threads that calls asio::io_service::run().

An additional thread per io_service is used to emulate asynchronous host resolution. This thread is created on the first call to either asio::ip::tcp::resolver::async_resolve() or asio::ip::udp::resolver::async_resolve().

Mac OS X

Demultiplexing Mechanism

Uses kqueue for demultiplexing.

Threads

Demultiplexing using kqueue is performed in one of the threads that calls asio::io_service::run().

An additional thread per io_service is used to emulate asynchronous host resolution. This thread is created on the first call to either asio::ip::tcp::resolver::async_resolve() or asio::ip::udp::resolver::async_resolve().

Windows 95, 98 and Me

Demultiplexing Mechanism

Uses select for demultiplexing.

Threads

Demultiplexing using select is performed in one of the threads that calls asio::io_service::run().

An additional thread per io_service is used to emulate asynchronous host resolution. This thread is created on the first call to either asio::ip::tcp::resolver::async_resolve() or asio::ip::udp::resolver::async_resolve().

Windows NT, 2000 and XP

Demultiplexing Mechanism

Uses overlapped I/O and I/O completion ports for all asynchronous datagram_socket, stream_socket and socket_acceptor operations except for asynchronous connect.

Uses select for deadline_timer operations and for emulating asynchronous connect.

Threads

Demultiplexing using I/O completion ports is performed in all threads that call asio::io_service::run().

An additional thread per io_service is used to for the select demultiplexing. This thread is created whenever the first deadline_timer, datagram_socket, stream_socket or socket_acceptor is created.

An additional thread per io_service is used to emulate asynchronous host resolution. This thread is created on the first call to either asio::ip::tcp::resolver::async_resolve() or asio::ip::udp::resolver::async_resolve().

asio 0.3.8rc3 Home | Reference | Tutorial | Examples | Design