]> git.lizzy.rs Git - rust.git/commit
rustuv: Reimplement without using std::rt::sched
authorAlex Crichton <alex@alexcrichton.com>
Fri, 13 Dec 2013 01:47:48 +0000 (17:47 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 24 Dec 2013 22:42:00 +0000 (14:42 -0800)
commit429313de69cb2ddd1f076017968d1862ef02b455
tree6bdf9da3c58a3a38e22fcc958c6b9e91509a0695
parent1ca77268d97b62e2fcaa1642aaf9313e164963b3
rustuv: Reimplement without using std::rt::sched

This reimplements librustuv without using the interfaces provided by the
scheduler in libstd. This solely uses the new Runtime trait in order to
interface with the local task and perform the necessary scheduling operations.

The largest snag in this refactoring is reimplementing homing. The new runtime
trait exposes no concept of "homing" a task or forcibly sending a task to a
remote scheduler (there is no concept of a scheduler). In order to reimplement
homing, the transferrence of tasks is now done at the librustuv level instead of
the scheduler level. This means that all I/O loops now have a concurrent queue
which receives homing messages and requests.

This allows the entire implementation of librustuv to be only dependent on the
runtime trait, severing all dependence of librustuv on the scheduler and related
green-thread functions.

This is all in preparation of the introduction of libgreen and libnative.

At the same time, I also took the liberty of removing all glob imports from
librustuv.
17 files changed:
src/librustuv/addrinfo.rs
src/librustuv/async.rs
src/librustuv/file.rs
src/librustuv/homing.rs [new file with mode: 0644]
src/librustuv/idle.rs
src/librustuv/lib.rs
src/librustuv/macros.rs
src/librustuv/net.rs
src/librustuv/pipe.rs
src/librustuv/process.rs
src/librustuv/queue.rs [new file with mode: 0644]
src/librustuv/signal.rs
src/librustuv/stream.rs
src/librustuv/timer.rs
src/librustuv/tty.rs
src/librustuv/uvio.rs
src/librustuv/uvll.rs