dpc / mioco.pre-0.9

Scalable, coroutine-based, asynchronous IO handling library for Rust programming language. (aka MIO COroutines).
Mozilla Public License 2.0
457 stars 30 forks source link

No way to cancel notifications - select! on a lot of channels in loop can accumulate tons of notifications. #140

Closed dpc closed 8 years ago

dpc commented 8 years ago

On every select! every io will do register and deregister. mpsc::Receiver will send itself a notification if it's not empty already.

As mio notifications (sender) are used for this - and there's no way of cancelation (like eg. timers), in case of a lot of channels being used in one select a lot of them can fire self-notification, over and over again, since at some point select_wait will return bogus values (from stale notification), leading to a select! being called over and over in the loop.

dpc commented 8 years ago

This have been fixed in https://github.com/dpc/mioco/commit/dcd321c47f55d5cb81403fe39a32dd1971ff9722 .