On Fri, Oct 26, 2012 at 11:44 PM, Jeff Rogers <dv...@diphi.com> wrote: > Andrew Piskorski wrote: >> On Fri, Oct 26, 2012 at 08:30:26PM +0100, Stephen Deasey wrote: >> >>> I was thinking it could work something like this: >>> >>> - driver acquires lock, takes first conn thread off queue, releases lock >> >> What if there are no conn threads waiting in the queue? >> > > Same as currently I'd think: the driver holds on to them as waiting > sockets. I think the handling of this is a bit less efficient than > putting them on the conn queue tho, as it creates more work for the > driver to do on every spin and it needs to get woken up once threads are > available.
- driver takes the lock, sees that there are no threads in the thread queue, puts conn on the back of the conn queue, does not signal anything, releases the lock - conn thread completes a request, takes the driver lock. -- If the conn queue is empty it puts itself on the front of the thread queue and releases the lock. -- Otherwise it takes then next conn and releases the lock. ------------------------------------------------------------------------------ WINDOWS 8 is here. Millions of people. Your app in 30 days. Visit The Windows 8 Center at Sourceforge for all your go to resources. http://windows8center.sourceforge.net/ join-generation-app-and-make-money-coding-fast/ _______________________________________________ naviserver-devel mailing list naviserver-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/naviserver-devel