Open
Description
We should investigate / experiment with moving SocketAsyncEngine down to be integrated with the ThreadPool. Today all of our logic for efficiently waiting on file descriptors (and specifically sockets) via epoll/kqueues is available only through System.Net.Sockets, and handles its own thread management. We should explore some kind of ThreadPool.RegisterFileDescriptorForPolling(IntPtr fd, Action<object> callback, object state)
Unix-specific API that would enable:
- other I/O-related APIs to utilize this waiting support, without needing an artificial dependency on Socket to do so
- the ThreadPool to manage the threads utilized by SocketAsyncEngine today, hopefully more efficiently and potentially avoiding some of the thread hopping we incur today
(I thought we already had an issue for this, but I can't find it; someone please feel free to close this as a dup if you find it :)
cc: @geoffkizer, @kouvel, @jkotas, @davidfowl