Skip to content

Investigate consolidating SocketAsyncEngine into ThreadPool #47631

Open
@stephentoub

Description

@stephentoub

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions