In a message dated 7/10/2003 10:53:32 AM Eastern Daylight Time, [EMAIL PROTECTED] writes:
On Thursday 10 July 2003 16:29, you wrote:
> every time.
> Only in NsSockClose mutex lock is used but in SockAccept and SockRelease
> firstSockPtr is used without mutex which may lead
> to some bad behaviour.

Indeed. Not only that. The "nactive" integer is also used unprotected.
Which means, there is a gross MT-hole there .(
We will have to correct this ASAP!
 
 
Hi,
 
I'm not sure this is the case.  Code in driver.c is single-threaded by design, i.e., there's a single "driver thread" which accepts new connections, does the read-ahead, dispatches the sockets with pre-read content to the thread pools for service, receives the sockets back for keep-alive or graceful close.  This is why the various lists and counters don't have locks around them.  The design assumption is this single thread can "spin" fast enough to keep a reasonable thread pool filled with incoming requests.
 
For NsSockClose, note there is a lock around the firstClosePtr list which is the list to return sockets to the driver thread.  Sockets are put there and a trigger is sent for driver to pull them off.
 
Anyway, that's the plan -- I could have missed something and allowed these lists to be fiddled by other threads by accident.
 
-Jim
 

-- AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.

Reply via email to