logo       

Re: Waiting on more then one event -- Accept_r: msg#00002

web.fastcgi.devel

Subject: Re: Waiting on more then one event -- Accept_r

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/



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise