4 ms·
Why can't they just use a lock around the accept() like the thundering herd solution, that way the thread shutting down the socket can do so knowing nothing els
by smegel 11y ago
Why can't they just use a lock around the accept() like the thundering herd solution, that way the thread shutting down the socket can do so knowing nothing else is accepting new connections at the time?
- _wmd 11y agoThe process accepting the connections (the kernel) runs entirely asynchronously to the application, and there is no way to signal it to stop accepting new connections except by calling close(), which has the dual effect of triggering the connection resets.