Re: lock on accept
- From: phil-news-nospam@xxxxxxxx
- Date: 31 May 2007 11:46:35 GMT
On 30 May 2007 14:16:20 -0700 David Schwartz <davids@xxxxxxxxxxxxx> wrote:
| The best way would be to write a program that blocks a few threads on
| 'accept' and then makes a connection to itself. If more than one
| thread unblocks but all but one get an error, then you have a non-
| ideal situation. If more than one thread actually succeeds, then you
| have a fatal situation.
You mean like 2 or more threads wake up from accept() with the same
descriptor given to each for the one socket that is connected?
| That is my recollection. Checking the apache lists and code comments
| might be instructive, I believe they've dealt with this issue
| extensively. (Note that they mainly dealt with multiple processes that
| had all inherited the same listening socket.)
Hopefully, any fix applies properly for both processes and threads.
| Also do not be confused. There is accept serialization still going on
| but it's for a completely different reason. Apache now allows you to
| listen on more than one port, which means more than one listening
| socket. This means Apache has to use 'select' and then call 'accept'.
| The serialization is to prevent all the threads/processes from waking
| from 'select', which the OS must do because it cannot be sure any of
| them are actually going to call 'accept'.
Maybe we need some kind of multi-socket accept() or container socket.
--
|---------------------------------------/----------------------------------|
| Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
| first name lower case at ipal.net / spamtrap-2007-05-31-0643@xxxxxxxx |
|------------------------------------/-------------------------------------|
.
- References:
- lock on accept
- From: raxitsheth2000
- Re: lock on accept
- From: David Schwartz
- Re: lock on accept
- From: raxitsheth2000
- Re: lock on accept
- From: David Schwartz
- lock on accept
- Prev by Date: Re: piping a group of "echo" to a program
- Next by Date: Re: large file support && ! large file support
- Previous by thread: Re: lock on accept
- Next by thread: Finding the current position in a file
- Index(es):
Relevant Pages
|