1[/ 2 / Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) 3 / 4 / Distributed under the Boost Software License, Version 1.0. (See accompanying 5 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 /] 7 8[section:implementation Platform-Specific Implementation Notes] 9 10This section lists platform-specific implementation details, such as the 11default demultiplexing mechanism, the number of threads created internally, and 12when threads are created. 13 14 15[heading Linux Kernel 2.4] 16 17Demultiplexing mechanism: 18 19* Uses `select` for demultiplexing. This means that the number of file 20descriptors in the process cannot be permitted to exceed `FD_SETSIZE`. 21 22Threads: 23 24* Demultiplexing using `select` is performed in one of the threads that calls 25`io_context::run()`, `io_context::run_one()`, `io_context::poll()` or 26`io_context::poll_one()`. 27 28* An additional thread per `io_context` is used to emulate asynchronous host 29resolution. This thread is created on the first call to either 30`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`. 31 32Scatter-Gather: 33 34* At most `min(64,IOV_MAX)` buffers may be transferred in a single operation. 35 36[heading Linux Kernel 2.6] 37 38Demultiplexing mechanism: 39 40* Uses `epoll` for demultiplexing. 41 42Threads: 43 44* Demultiplexing using `epoll` is performed in one of the threads that calls 45`io_context::run()`, `io_context::run_one()`, `io_context::poll()` or 46`io_context::poll_one()`. 47 48* An additional thread per `io_context` is used to emulate asynchronous host 49resolution. This thread is created on the first call to either 50`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`. 51 52Scatter-Gather: 53 54* At most `min(64,IOV_MAX)` buffers may be transferred in a single operation. 55 56 57[heading Solaris] 58 59Demultiplexing mechanism: 60 61* Uses [^/dev/poll] for demultiplexing. 62 63Threads: 64 65* Demultiplexing using [^/dev/poll] is performed in one of the threads that 66calls `io_context::run()`, `io_context::run_one()`, `io_context::poll()` or 67`io_context::poll_one()`. 68 69* An additional thread per `io_context` is used to emulate asynchronous host 70resolution. This thread is created on the first call to either 71`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`. 72 73Scatter-Gather: 74 75* At most `min(64,IOV_MAX)` buffers may be transferred in a single operation. 76 77 78[heading QNX Neutrino] 79 80Demultiplexing mechanism: 81 82* Uses `select` for demultiplexing. This means that the number of file 83descriptors in the process cannot be permitted to exceed `FD_SETSIZE`. 84 85Threads: 86 87* Demultiplexing using `select` is performed in one of the threads that calls 88`io_context::run()`, `io_context::run_one()`, `io_context::poll()` or 89`io_context::poll_one()`. 90 91* An additional thread per `io_context` is used to emulate asynchronous host 92resolution. This thread is created on the first call to either 93`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`. 94 95Scatter-Gather: 96 97* At most `min(64,IOV_MAX)` buffers may be transferred in a single operation. 98 99 100[heading Mac OS X] 101 102Demultiplexing mechanism: 103 104* Uses `kqueue` for demultiplexing. 105 106Threads: 107 108* Demultiplexing using `kqueue` is performed in one of the threads that calls 109`io_context::run()`, `io_context::run_one()`, `io_context::poll()` or 110`io_context::poll_one()`. 111 112* An additional thread per `io_context` is used to emulate asynchronous host 113resolution. This thread is created on the first call to either 114`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`. 115 116Scatter-Gather: 117 118* At most `min(64,IOV_MAX)` buffers may be transferred in a single operation. 119 120 121[heading FreeBSD] 122 123Demultiplexing mechanism: 124 125* Uses `kqueue` for demultiplexing. 126 127Threads: 128 129* Demultiplexing using `kqueue` is performed in one of the threads that calls 130`io_context::run()`, `io_context::run_one()`, `io_context::poll()` or 131`io_context::poll_one()`. 132 133* An additional thread per `io_context` is used to emulate asynchronous host 134resolution. This thread is created on the first call to either 135`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`. 136 137Scatter-Gather: 138 139* At most `min(64,IOV_MAX)` buffers may be transferred in a single operation. 140 141 142[heading AIX] 143 144Demultiplexing mechanism: 145 146* Uses `select` for demultiplexing. This means that the number of file 147descriptors in the process cannot be permitted to exceed `FD_SETSIZE`. 148 149Threads: 150 151* Demultiplexing using `select` is performed in one of the threads that calls 152`io_context::run()`, `io_context::run_one()`, `io_context::poll()` or 153`io_context::poll_one()`. 154 155* An additional thread per `io_context` is used to emulate asynchronous host 156resolution. This thread is created on the first call to either 157`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`. 158 159Scatter-Gather: 160 161* At most `min(64,IOV_MAX)` buffers may be transferred in a single operation. 162 163 164[heading HP-UX] 165 166Demultiplexing mechanism: 167 168* Uses `select` for demultiplexing. This means that the number of file 169descriptors in the process cannot be permitted to exceed `FD_SETSIZE`. 170 171Threads: 172 173* Demultiplexing using `select` is performed in one of the threads that calls 174`io_context::run()`, `io_context::run_one()`, `io_context::poll()` or 175`io_context::poll_one()`. 176 177* An additional thread per `io_context` is used to emulate asynchronous host 178resolution. This thread is created on the first call to either 179`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`. 180 181Scatter-Gather: 182 183* At most `min(64,IOV_MAX)` buffers may be transferred in a single operation. 184 185 186[heading Tru64] 187 188Demultiplexing mechanism: 189 190* Uses `select` for demultiplexing. This means that the number of file 191descriptors in the process cannot be permitted to exceed `FD_SETSIZE`. 192 193Threads: 194 195* Demultiplexing using `select` is performed in one of the threads that calls 196`io_context::run()`, `io_context::run_one()`, `io_context::poll()` or 197`io_context::poll_one()`. 198 199* An additional thread per `io_context` is used to emulate asynchronous host 200resolution. This thread is created on the first call to either 201`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`. 202 203Scatter-Gather: 204 205* At most `min(64,IOV_MAX)` buffers may be transferred in a single operation. 206 207 208[heading Windows 95, 98 and Me] 209 210Demultiplexing mechanism: 211 212* Uses `select` for demultiplexing. 213 214Threads: 215 216* Demultiplexing using `select` is performed in one of the threads that calls 217`io_context::run()`, `io_context::run_one()`, `io_context::poll()` or 218`io_context::poll_one()`. 219 220* An additional thread per `io_context` is used to emulate asynchronous host 221resolution. This thread is created on the first call to either 222`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`. 223 224Scatter-Gather: 225 226* For sockets, at most 16 buffers may be transferred in a single operation. 227 228 229[heading Windows NT, 2000, XP, 2003, Vista, 7 and 8] 230 231Demultiplexing mechanism: 232 233* Uses overlapped I/O and I/O completion ports for all asynchronous socket 234operations except for asynchronous connect. 235 236* Uses `select` for emulating asynchronous connect. 237 238Threads: 239 240* Demultiplexing using I/O completion ports is performed in all threads that call 241`io_context::run()`, `io_context::run_one()`, `io_context::poll()` or 242`io_context::poll_one()`. 243 244* An additional thread per `io_context` is used to trigger timers. This thread 245is created on construction of the first `basic_deadline_timer` or 246`basic_waitable_timer` objects. 247 248* An additional thread per `io_context` is used for the `select` 249demultiplexing. This thread is created on the first call to `async_connect()`. 250 251* An additional thread per `io_context` is used to emulate asynchronous host 252resolution. This thread is created on the first call to either 253`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`. 254 255Scatter-Gather: 256 257* For sockets, at most 64 buffers may be transferred in a single operation. 258 259* For stream-oriented handles, only one buffer may be transferred in a single 260operation. 261 262[heading Windows Runtime] 263 264Boost.Asio provides limited support for the Windows Runtime. It requires that the 265language extensions be enabled. Due to the restricted facilities exposed by the 266Windows Runtime API, the support comes with the following caveats: 267 268* The core facilities such as the `io_context`, `strand`, buffers, composed 269 operations, timers, etc., should all work as normal. 270 271* For sockets, only client-side TCP is supported. 272 273* Explicit binding of a client-side TCP socket is not supported. 274 275* The `cancel()` function is not supported for sockets. Asynchronous 276 operations may only be cancelled by closing the socket. 277 278* Operations that use `null_buffers` are not supported. 279 280* Only `tcp::no_delay` and `socket_base::keep_alive` options are supported. 281 282* Resolvers do not support service names, only numbers. I.e. you must 283 use "80" rather than "http". 284 285* Most resolver query flags have no effect. 286 287Demultiplexing mechanism: 288 289* Uses the `Windows::Networking::Sockets::StreamSocket` class to implement 290 asynchronous TCP socket operations. 291 292Threads: 293 294* Event completions are delivered to the Windows thread pool and posted to the 295 `io_context` for the handler to be executed. 296 297* An additional thread per `io_context` is used to trigger timers. This thread 298 is created on construction of the first timer objects. 299 300Scatter-Gather: 301 302* For sockets, at most one buffer may be transferred in a single operation. 303 304 305[endsect] 306