FW: [PATCH] Stop packet_recv greediness, stop using event_add_timed

Sam Liddicott sam at liddicott.com
Mon May 18 16:32:47 GMT 2009

Volker; hows this for style and intrusiveness?

(It still needs modifying to avoid reading most of the queued bytes in 
cases where the packet size isn't known).

I don't yet have the data on how it affects throughput, but it does have 
the effect of letting a server send out it's responses ASAP rather than 
wait until all requests have been processed.

Further work needs doing on fairness between different sockets, but that 
will follow later, as Tom and I (mostly Tom) are still looking at those 


-----Original Message-----
From: Sam Liddicott [mailto:sam at liddicott.com]
Sent: 18 May 2009 15:28
Subject: [PATCH] Stop packet_recv greediness, stop using event_add_timed

Avoid using event_add_timed when it is possible by leaving at
least one byte in the socket so that the select loop will re-select
in  due course.

Where the one byte left is seen to be important to the packet, it is
fetched immediately so that the current packet is not delayed.

If there is nothing left in the socket and yet more received data
in the packet context to process, the a 0 timer callback is used as before

NOT Signed off by: Sam Liddicott <sam at liddicott.com>
  source4/lib/stream/packet.c |   30 ++++++++++++++++++++++++++++++
  1 files changed, 30 insertions(+), 0 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 113f14cd67df070b75d7af87258a2a014a980ff9.diff
Type: text/x-patch
Size: 2129 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20090518/c43d9801/113f14cd67df070b75d7af87258a2a014a980ff9.bin

More information about the samba-technical mailing list