I am curious if anyone has attempted to somehow combine the async socket IO with PPL. More specifically if you have a socket server the logical implementation will be to use the socket async features. Then on each socket once the data is in, one can use the PPL to run in parallel various tasks. The issue then is the interaction between the two different thread pool management. The async socket will have its thread pool which is not aware of the PPL and vice versa.
Maybe there is a way to somehow merge the async socket IO into the PPL?
I have an adapter between IO completion ports and PPL tasks. While this doesn't provide a way to "manage" the two different thread pools, it’s a way to glue the models together in a way where you can write wait-free code. The advantage with this approach is that I can use the CreateIoCompletionPort API to specify how many threads I want involved with this IO and thus I have created a "governor" for the IO controller.
Another option is to use UMS with synchronous IO and allow the (user-mode) scheduler's communication with the kernel about the kernel-blocking operations to manage your resources.
Dana Groff, Senior Program Manager Parallel Computing, Concurrency Runtime