rust/src/librustuv
Alex Crichton cc34dbb840 Expose whether event loops have active I/O
The green scheduler can optimize its runtime based on this by deciding to not go
to sleep in epoll() if there is no active I/O and there is a task to be stolen.

This is implemented for librustuv by keeping a count of the number of tasks
which are currently homed. If a task is homed, and then performs a blocking I/O
operation, the count will be nonzero while the task is blocked. The homing count
is intentionally 0 when there are I/O handles, but no handles currently blocked.
The reason for this is that epoll() would only be used to wake up the scheduler
anyway.

The crux of this change was to have a `HomingMissile` contain a mutable borrowed
reference back to the `HomeHandle`. The rest of the change was just dealing with
this fallout. This reference is used to decrement the homed handle count in a
HomingMissile's destructor.

Also note that the count maintained is not atomic because all of its
increments/decrements/reads are all on the same I/O thread.
2014-02-12 09:46:31 -08:00
..
access.rs Implement clone() for TCP/UDP/Unix sockets 2014-02-05 11:43:49 -08:00
addrinfo.rs Expose whether event loops have active I/O 2014-02-12 09:46:31 -08:00
async.rs Remove do keyword from librustuv 2014-01-29 09:15:41 -05:00
file.rs Expose whether event loops have active I/O 2014-02-12 09:46:31 -08:00
homing.rs Implement clone() for TCP/UDP/Unix sockets 2014-02-05 11:43:49 -08:00
idle.rs std: Remove try_send_deferred plus all fallout 2014-02-03 12:05:16 -08:00
lib.rs Expose whether event loops have active I/O 2014-02-12 09:46:31 -08:00
macros.rs rustuv: Require all results are used and fix fallout 2014-02-03 09:32:35 -08:00
net.rs Expose whether event loops have active I/O 2014-02-12 09:46:31 -08:00
pipe.rs Expose whether event loops have active I/O 2014-02-12 09:46:31 -08:00
process.rs Expose whether event loops have active I/O 2014-02-12 09:46:31 -08:00
queue.rs Shuffle around ownership in concurrent queues 2014-02-11 16:32:00 -08:00
rc.rs Implement clone() for TCP/UDP/Unix sockets 2014-02-05 11:43:49 -08:00
signal.rs Rewrite channels yet again for upgradeability 2014-02-11 16:32:00 -08:00
stream.rs Expose whether event loops have active I/O 2014-02-12 09:46:31 -08:00
timer.rs Expose whether event loops have active I/O 2014-02-12 09:46:31 -08:00
tty.rs rustuv: Reimplement without using std::rt::sched 2013-12-24 14:42:00 -08:00
uvio.rs Expose whether event loops have active I/O 2014-02-12 09:46:31 -08:00
uvll.rs Removed all instances of XXX in preparation for relaxing of FIXME rule 2014-01-26 14:42:53 -05:00