[PATCH] Fix run_events() to run all ready events instead of the first one in the list

Volker Lendecke Volker.Lendecke at SerNet.DE
Wed Mar 4 16:57:04 GMT 2009


On Wed, Mar 04, 2009 at 08:42:57AM -0800, Jeremy Allison wrote:
> The thing is we don't actually *need* to run multiple events
> inside the event loop.
> 
> As we have reliable queuing of events, then all running one
> event at a time means we will call the event loop again, once
> for each event we have pending.
> 
> Yes, theoretically we could improve efficiency by running
> more than one even inside the loop, but I don't think the
> added complexity is worth the (very small) efficiency gain
> that we would get.

The efficiency gain would probably be significant if we had
a single process model and at the same time rely on
select(2). In Samba 3 we don't have the single process
model, i.e. relatively few events, and in Samba 4 we can use
epoll which makes the event loop a lot cheaper than a select
with lots of file descriptors.

Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20090304/0c7509c3/attachment.bin


More information about the samba-technical mailing list