[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: revised lightweight dispatcher

At 02:28 PM 10/15/2005, Howard Chu wrote:
>Kurt D. Zeilenga wrote:
>>I've committed a revised lightweight dispatcher.
>>Aside from various cleanups (no suspend flags),
>>the main difference is writers are now spun out
>>into separate threads.  Also, readers now spawn
>>operation threads instead of performing the
>>operation itself.  This is to reduce the clear
>>read flag handling.
>>Initial tests show this revision performs
>>reasonably well.
>I see it still uses the lazy semaphore code, so the listener thread can still be blocked and prevented from runnning the idletimeout checker.

Yes, haven't looked into this yet.

>The looping problem I referred to earlier appears to have been minimized. I still see one or two extra wakeups on the read event, but it doesn't seem to be a runaway condition any more.
>Obviously there is still a race condition between the time the listener kicks off  the read/write handler and when it goes back to select/epoll. If the handler hasn't performed enough I/O on the descriptor yet, the event will fire again.

Shouldn't.  I clear the read flags in the dispatcher
BEFORE spawning the worker thread, then have the worker
set it only after they have completed reading (accepting)
what they want.

> -- Howard Chu
> Chief Architect, Symas Corp.  http://www.symas.com
> Director, Highland Sun        http://highlandsun.com/hyc
> OpenLDAP Core Team            http://www.openldap.org/project/