public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* select() doesn't respect SO_RCVLOWAT ?
@ 2005-03-10 21:58 Felix Matathias
  2005-03-11  5:43 ` Willy Tarreau
  2005-03-11 19:09 ` Alan Cox
  0 siblings, 2 replies; 7+ messages in thread
From: Felix Matathias @ 2005-03-10 21:58 UTC (permalink / raw)
  To: linux-kernel


Dear all,

I am running a 2.4.21-9.0.3.ELsmp #1 kernel and I can setsockopt and 
getsockopt correctly the SO_RCVLOWAT option, but select() seems to mark a 
socket readable even if a single byte is ready to be read. Then, a read() 
blocks until the specified number of bytes in SO_RCVLOWAT makes it to the 
socket buffer.

This is the exact opposite behaviour of what I yould have 
expected/desired. Our application receives data at many Khz rate and we 
want to avoid reading the socket until a predetermined amount of data is 
sent, to avoid partial reads. SO_RCVLOWAT seemed to be a nice way to 
implement that.

An earlier message by Alan Cox was a bit cryptic:

"But is the cost of all those special case checks and all the handling
for it such as select computing if enough tcp packets together accumulated
worth the cost on every app not using LOWAT for the microscopic gain given
that essentially nobody uses it."

Does this mean that select() in Linux will wake up no matter what 
SO_RCVLOWAT is set to ?

Best Regards,
Felix Matathias

P.S. I would appreciate if you could also cc your response to me.

-- 

______________________________________________________________________
Felix Matathias of Columbia University, Nevis Labs

Brookhaven National Lab           cell : 631-988-3694
Bldg 1005, 3-304                  web  : http://www.matathias.com
Upton, NY, 11973                  photo: http://www.pbase.com/matathias
tel/fax :631-344-7622/3253        email: felix@nevis.columbia.edu
_______________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-03-22  2:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-10 21:58 select() doesn't respect SO_RCVLOWAT ? Felix Matathias
2005-03-11  5:43 ` Willy Tarreau
2005-03-11 19:09 ` Alan Cox
2005-03-11 20:26   ` Felix Matathias
2005-03-14 13:24     ` Alan Cox
2005-03-14 13:34       ` YOSHIFUJI Hideaki / 吉藤英明
2005-03-22  2:30     ` Robert White

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox