> The moment we perform I/O… both the futures and the generic thread pool models fall short.
On Windows they usually work fine. OS kernel support is the key. OS-provided thread pool scales really well. I’m talking about the modern one from threadpoolapiset.h, StartThreadpoolIo / SubmitThreadpoolWork API functions.
> we might want to limit network requests going to individual hosts, independently from disk reads or writes, or from database transactions.
There’re APIs like ReleaseSemaphoreWhenCallbackReturns and SetEventWhenCallbackReturns.
On Windows they usually work fine. OS kernel support is the key. OS-provided thread pool scales really well. I’m talking about the modern one from threadpoolapiset.h, StartThreadpoolIo / SubmitThreadpoolWork API functions.
> we might want to limit network requests going to individual hosts, independently from disk reads or writes, or from database transactions.
There’re APIs like ReleaseSemaphoreWhenCallbackReturns and SetEventWhenCallbackReturns.