Closed dpc closed 9 years ago
Current idea: after mio
introduces tick()
, mioco::Server
, should keep a "tick" counter, and pass it to EventSource::ready()
, Coroutine
should remember the tick counter on the last reregister
and skip all EventSources::ready()
that had the tick the same as the last saved one. Note: the event source still needs to be reregistered, even if ignored.
Another, probably saner approach, would be to change select()
semantics and thus make the spurious wakeups harmless. If split between select()
and following blocking operation could be removed without hindering the API usability, it would help a lot. The biggest problem here is that select can be called on a set of non-uniform event sources.
https://github.com/carllerche/mio/pull/231 has landed. We can remove workaround tick += 1
and put it in proper place.
Implemented in f747377e
mio
can generate spurious events due to: https://github.com/carllerche/mio/issues/219 .Spurious events can mess with
select()
semantics. After coroutine is resumed after select(), the Event Source that was returned must not block on a next corresponding operation. If the waking event was a spurious one, the whole coroutine could block on something that might not even happen again.