public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* epoll'ing tcp sockets for reading
@ 2009-12-19 12:02 Nikolai ZHUBR
  2009-12-19 18:07 ` Davide Libenzi
  0 siblings, 1 reply; 10+ messages in thread
From: Nikolai ZHUBR @ 2009-12-19 12:02 UTC (permalink / raw)
  To: linux-kernel

Hello people, I have a question about epoll'ing tcp sockets.

Is it possible (with epoll or some other good method) to get userspace
notified not only of the fact that some data has become available
for the socket, but also of the respective _size_ available for
reading connected with this exact event?

Yes, read'ing until EAGAIN or using FIONREAD would provide this
sort of information, but there is a problem. In case of subsequent
continuous data arrival, an application could get stuck reading
data for one socket infinitely (after epoll return, just before
the next epoll), unless it implements some kind of artifical safety
measures.

To my understanding, EPOLLONESHOT does not suffice here, because
it only "fixes" the epoll'ing part but not the read'ing part, whereas
_both_ epoll'ing and read'ing appear to be responsible. Therefore,
"event atomicity" is lost anyway. Or am I wrong?

(Please CC me, I'm not subscribed)

Thank you!

Nikolai ZHUBR



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

end of thread, other threads:[~2009-12-21  9:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-19 12:02 epoll'ing tcp sockets for reading Nikolai ZHUBR
2009-12-19 18:07 ` Davide Libenzi
2009-12-19 22:38   ` Re[2]: " Nikolai ZHUBR
2009-12-19 22:56     ` Davide Libenzi
2009-12-20  0:26       ` Re[3]: " Nikolai ZHUBR
2009-12-20 15:54         ` Davide Libenzi
2009-12-20 16:14           ` Willy Tarreau
2009-12-20 23:26             ` Re[2]: " Nikolai ZHUBR
2009-12-21  5:46               ` Willy Tarreau
2009-12-21  9:34                 ` Re[2]: " Nikolai ZHUBR

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