In example 3 of the HTTP server (boost 2.44), the IO service is created without a thread count hint. Under Windows, one normally passes the thread count to CreateIoCompletionPort(). boost:asio has an IO Service ctor that takes the thread count, but that ctor is not used in this example. And the thread count is known.
My question is: is there a reason to create the IO Service without the thread count? Does boost:asio assume one would never create more threads than one per core? Note if the thread count passed to CreateIoCompletionPort() is zero, the system will allow one thread per core concurrently running threads.
When you call the parameter-less constructor on
io_service, the call toCreateIoCompletionPortwinds up using a thread count of 0xffffffff in the code here:Not sure how Windows interprets this but the call works OK, so I assume this is the same as using 0. I guess the assumption is that the OS knows best?