| Age | Commit message (Collapse) | Author | Lines |
|
Instead of a furious storm of idle callbacks we just have one. This is a major performance gain - around 40% on my machine for the ping pong bench.
Also in this PR is a cleanup commit for the scheduler code. Was previously up as a separate PR, but bors load + imminent merge hell led me to roll them together. Was #8549.
|
|
|
|
|
|
updated, a minor amount of support type restructing has happened, methods have been reordered, and some duplicate code has been purged.
|
|
PausibleIdleCallback and placed the appropriate signatures in rtio and implementation into uvio.
|
|
Full description in comments.
|
|
|
|
from nondeterministic deadlock and also pending scheduler messages on scheduler shutdown.
|
|
queue shared by each scheduler. Now there is a separate work queue for each scheduler, and work is "stolen" from other queues when it is exhausted locally.
|
|
|
|
|
|
|
|
Every time run_sched_once performs a 'scheduling action' it needs to guarantee
that it runs at least one more time, so enqueue another run_sched_once callback.
The primary reason it needs to do this is because not all async callbacks
are guaranteed to run, it's only guaranteed that *a* callback will run after
enqueing one - some may get dropped.
At the moment this means we wastefully create lots of callbacks to ensure that
there will *definitely* be a callback queued up to continue running the scheduler.
The logic really needs to be tightened up here.
|
|
this has been replaced by `for`
|
|
|
|
|
|
This is the last major runtime feature needed for the transition to the new scheduler.
|
|
|
|
|
|
scheduler functions slightly
|
|
inside the task struct, and also added an assert to verify that send is never called inside scheduler context as it is undefined (BROKEN) if that happens
|
|
would "bounch" a regular task in and out of the work queue without allowing a different scheduler to run it.
|
|
old design the TLS held the scheduler struct, and the scheduler struct
held the active task. This posed all sorts of weird problems due to
how we wanted to use the contents of TLS. The cleaner approach is to
leave the active task in TLS and have the task hold the scheduler. To
make this work out the scheduler has to run inside a regular task, and
then once that is the case the context switching code is massively
simplified, as instead of three possible paths there is only one. The
logical flow is also easier to follow, as the scheduler struct acts
somewhat like a "token" indicating what is active.
These changes also necessitated changing a large number of runtime
tests, and rewriting most of the runtime testing helpers.
Polish level is "low", as I will very soon start on more scheduler
changes that will require wiping the polish off. That being said there
should be sufficient comments around anything complex to make this
entirely respectable as a standalone commit.
|
|
Change the former repetition::
for 5.times { }
to::
do 5.times { }
.times() cannot be broken with `break` or `return` anymore; for those
cases, use a numerical range loop instead.
|
|
Makes it more obvious what's going on
|
|
This moves the raw struct layout of closures, vectors, boxes, and strings into a
new `unstable::raw` module. This is meant to be a centralized location to find
information for the layout of these values.
As safe method, `repr`, is provided to convert a rust value to its raw
representation. Unsafe methods to convert back are not provided because they are
rarely used and too numerous to write an implementation for each (not much of a
common pattern).
|
|
|
|
|
|
|
|
Conflicts:
src/libextra/test.rs
src/libstd/at_vec.rs
src/libstd/cleanup.rs
src/libstd/rt/comm.rs
src/libstd/rt/global_heap.rs
src/libstd/task/spawn.rs
src/libstd/unstable/lang.rs
src/libstd/vec.rs
src/rt/rustrt.def.in
src/test/run-pass/extern-pub.rs
|
|
|
|
|
|
of tasks as a component of coroutines.
|
|
|
|
|
|
was then matched on to instead use an enum.
|
|
|
|
Conflicts:
src/libstd/rt/comm.rs
src/libstd/rt/mod.rs
src/libstd/rt/sched.rs
src/libstd/rt/task.rs
src/libstd/rt/test.rs
src/libstd/rt/tube.rs
src/libstd/rt/uv/uvio.rs
src/libstd/rt/uvio.rs
src/libstd/task/spawn.rs
|
|
Conflicts:
src/libstd/rt/sched.rs
src/libstd/rt/task.rs
src/libstd/rt/test.rs
src/libstd/task/mod.rs
src/libstd/task/spawn.rs
|
|
|
|
|
|
This is supposed to be an efficient way to link the lifetimes
of tasks into a tree. JoinLatches form a tree and when `release`
is called they wait on children then signal the parent.
This structure creates zombie tasks which currently keep the entire
task allocated. Zombie tasks are supposed to be tombstoned but that
code does not work correctly.
|
|
pinned to them
|
|
have been planned for, and no forwarding of tasks off special schedulers is supported.
|
|
branch and modified the incoming new file lang.rs to be api-compatible
|
|
|
|
|
|
|
|
Part of #3853
|
|
|