in reply to Re^7: Help designing a threaded service
in thread Help designing a threaded service
On at least some versions of some Unix systems, multiple processes waiting on the same socket will cause all of them to be awoken but only the first one to ask will get the connection or data that triggered them to be awoken. Since nginx is setting up "necessary work queue requests" in order to handle the connection coming it, it is useful for only one process to do that. Though I'm not completely convinced that the nginx authors didn't implement this protection out of misunderstanding rather than real need.
I believe that it is the case that you don't need to worry about this implementation detail at least in most cases.
My vague memory of one report of this "every process wakes up" "problem" was just noting the wasted resources and that only one of the waiting processes would return from select(2) (or equivalent). I certainly don't expect more than one process to actually return from accept() when many of them are blocked inside an accept() call.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: Help designing a threaded service (Your belief versus the collective finding of t'internet)
by BrowserUk (Patriarch) on Jan 26, 2014 at 20:05 UTC |