httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <>
Subject Re: Thread/Process model discussion.
Date Fri, 29 Jan 1999 22:26:36 GMT

On Thu, 28 Jan 1999, Ryan Bloom wrote:

> 5)  Specialized threads -
> 	Timing is done with a timing thread.  Each thread tells the timer
> it wants notification when x seconds has gone by.  The timer will send a
> notification to that thread at correct time.  Do we want the timer thread
> to wake up once a second to keep track of time, or should all threads
> ignore sigalarm except for the timer thread, and let the OS/APR provide
> timer capabilities.

Asynchronous notification is non-portable, and error prone.  The timer
thread isn't required... we only do this sort of thing in 1.x for legacy
reasons -- that's just how it was always implemented.  I've got a few past
rants in the archive about this -- the main problem with async
notification is that 3rd party libraries (and I suspect many libc
implementations) don't expect it.

Instead what you want to use is non-blocking sockets (and pipes[1]) and
implement a send/recv with timeout by using select/poll (or completion
ports on win32).  This gives you synchronous notification of timeouts,
which is portable. 


[1] Did we ever figure out how to do CGI with timeouts in win32?  Last I
remember there is a method to do IPC with timeouts in win32 but it's not
the IPC method used to implement CGI... and nobody knew how to get
timeouts for a read/write on a pipe. 

View raw message