Re: Waiting on more then one event -- Accept_r
Robert Jordan <[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel,gmane.spam.detected |
|---|---|
| Message-ID | <[email protected]> |
Artyom wrote: > Hello, > > There is a problem when I want to work with > multiple threads and receive other notifications > for example, timeout, cache notifications etc. > > The purposed solution on the lists is: > > pthread_mutex_lock > select(incoming fd,other event fd,timeout) > FCGX_Accept_r() > pthread_mutex_unlock > > Comments: > - I can't do select outside lock because > I may find two threads accepting same request > and one of them being blocked. The locks around select(2) are not necessary, since only one thread will be woken up by select. I'm not sure about poll, but it will work at least on Linux. Robert ___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/