But Ns_ConnClose is called from within connection thread and is using mutex for firstClosePtr but at the same time single threaded driver.c is using the same pointer without any mutexes. After i put mutex there i started receiving much less "Bad file descriptor" errors and crashes which may be unrelated completely but on my fast dual-CPU machine with many concurrent connections that might be the case.
Jim Davidson wrote:
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.
-- 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.
