[lkml]   [2001]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] /dev/epoll update ...
> Stevens [UNPV1, in chapter on nonblocking accept] suggests that readiness
> notifications from the OS should only be considered hints, and that user
> programs should behave properly even if the OS feeds it false readiness
> events.

[ ... ]

> That said, the principle of least suprise would suggest that /dev/epoll should
> indeed return an accurate initial status. There are a lot of programmers who
> don't agree with Stevens on this issue, and who write code that breaks if you
> feed it incorrect readiness events.

They're living a lie :) A readiness event does not guarantee future
operations, it provides a hint of the status of things at the time the
event was generated. Networking events can happen that change the status
of sockets from when readiness events come in and when the app tries to
react to them..

- kernel gets ack, freeing tx queue space
- the kernel wakes up the task with some POLL_OUT event
- a packet comes in from the wire that resets the socket
- the app sees poll_out and tries to write, and is surprised

there are many more situations like this. readiness is _always_ only
a hint, and the app has to deal with this.

- z
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:03    [W:0.101 / U:1.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site