about summary refs log tree commit diff
path: root/src/libstd/rt/sched.rs
AgeCommit message (Collapse)AuthorLines
2013-08-01minor tweaks - unboxed the coroutine so that it is no longer a ~ pointer ↵toddaaro-3/+31
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
2013-08-01Fixed a race where a scheduler configured to only run tasks pinned to it ↵toddaaro-7/+34
would "bounch" a regular task in and out of the work queue without allowing a different scheduler to run it.
2013-08-01A major refactoring that changes the way the runtime uses TLS. In thetoddaaro-573/+454
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.
2013-08-01std: Change `Times` trait to use `do` instead of `for`blake2-ppc-1/+1
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.
2013-07-30std::rt: Change Thread interface to require an explicit joinBrian Anderson-6/+7
Makes it more obvious what's going on
2013-07-26Consolidate raw representations of rust valuesAlex Crichton-2/+2
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).
2013-07-20Change the HOF context switchers to pass a BlockedTask instead of a ~Task.Ben Blum-23/+60
2013-07-20Do a task-killed check at the start of task 'timeslices'.Ben Blum-0/+11
2013-07-16Rename Option swap_unwrap to take_unwrap. Fixes Issue#7764Austin King-5/+5
2013-07-03Merge remote-tracking branch 'mozilla/master'Brian Anderson-2/+3
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
2013-07-01removed unnecessary import that slipped in during mergetoddaaro-1/+0
2013-07-01merging task/coroutine refactoring back into upstreamtoddaaro-19/+18
2013-07-01Refactored the runtime to view coroutines as a component of tasks, instead ↵toddaaro-337/+69
of tasks as a component of coroutines.
2013-06-26std::rt: Some cleanupBrian Anderson-18/+17
2013-06-20std::rt: WhitespaceBrian Anderson-2/+2
2013-06-19Modified a match in resume_task_from_queue that was returning an int that ↵toddaaro-17/+17
was then matched on to instead use an enum.
2013-06-17std: Rename `abort!` to `rtabort!` to match other macrosBrian Anderson-7/+7
2013-06-16Merge remote-tracking branch 'brson/io'Brian Anderson-100/+958
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
2013-06-15Merge remote-tracking branch 'brson/io-wip' into ioBrian Anderson-18/+20
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
2013-06-14redesigned the pinning to pin deal with things on dequeue, not on enqueuetoddaaro-181/+360
2013-06-13std::rt: Change the Task constructors to reflect a treeBrian Anderson-11/+11
2013-06-13std::rt: Add JoinLatchBrian Anderson-1/+4
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.
2013-06-12added functionality to tell schedulers to refuse to run tasks that are not ↵toddaaro-13/+35
pinned to them
2013-06-12A basic implementation of pinning tasks to schedulers. No IO interactions ↵toddaaro-42/+372
have been planned for, and no forwarding of tasks off special schedulers is supported.
2013-06-10debugged a compiler ICE when merging local::borrow changes into the main io ↵toddaaro-1/+1
branch and modified the incoming new file lang.rs to be api-compatible
2013-06-07std::rt: Reduce task stack size to 1MBBrian Anderson-1/+1
2013-06-05std::rt: Remove in incorrect assertBrian Anderson-1/+3
2013-06-05std::rt: Destroy the task start closure while in task contextBrian Anderson-1/+36
2013-06-04std::cell: Modernize constructorsPhilipp Brüschweiler-6/+6
Part of #3853
2013-06-01Remove all uses of `pub impl`. rs=stylePatrick Walton-25/+26
2013-05-30core::rt: deny(unused_imports, unused_mut, unused_variable)Brian Anderson-8/+3
2013-05-30core::rt: Fix two multithreading bugs and add a threadring testBrian Anderson-1/+65
This properly distributes the load now
2013-05-30core::rt: Begin recording scheduler metricsBrian Anderson-2/+16
2013-05-29core::rt: Add some notes about optimizationsBrian Anderson-0/+14
2013-05-29Merge remote-tracking branch 'brson/io' into incomingBrian Anderson-63/+266
Conflicts: src/libstd/rt/sched.rs
2013-05-23cleanup warnings from libstdErick Tryzelaar-1/+0
2013-05-22libstd: Fix merge fallout.Patrick Walton-0/+554