about summary refs log tree commit diff
path: root/src/libstd/rt/task.rs
AgeCommit message (Collapse)AuthorLines
2013-08-20auto merge of #8566 : toddaaro/rust/idle-opt+cleaning, r=catamorphism,brsonbors-1/+1
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.
2013-08-19std: Restore dynamic borrow trackingBrian Anderson-4/+14
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-0/+2
2013-08-16A round of code cleaning for the primary scheduler code. Comments have been ↵toddaaro-1/+1
updated, a minor amount of support type restructing has happened, methods have been reordered, and some duplicate code has been purged.
2013-08-16doc: correct spelling in documentation.Huon Wilson-2/+1
2013-08-13auto merge of #8475 : kmcallister/rust/stack_segment, r=brson,brsonbors-1/+1
Servo needs to tell SpiderMonkey about the stack bounds. r? @brson
2013-08-12rt::task: Make current_stack_segment publicKeegan McAllister-1/+1
Servo needs to tell SpiderMonkey about the stack bounds.
2013-08-12Clean up transitionary glue in task/spawn.rs. Don't hold kill-little-lock ↵Ben Blum-6/+4
for O(n) time, cf #3100, and optimize out several unneeded clone()s.
2013-08-09Remove the C++ runtime. SayonaraBrian Anderson-2/+2
2013-08-07std: Allow spawners to specify stack sizeBrian Anderson-14/+23
2013-08-07std::rt: Pull RUST_MIN_STACK from the environmentBrian Anderson-3/+3
2013-08-07std::rt: 2MB stacks againBrian Anderson-1/+1
2013-08-07std: add result.map_move, result.map_err_moveErick Tryzelaar-2/+2
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-2/+2
- Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
2013-08-05std::rt: Use magic to make TLS work from annihilated boxes. #8302Brian Anderson-0/+13
2013-08-04std::rt: 3MB stacks!Brian Anderson-2/+2
rustc needs *even more* megabytes when run without optimizations
2013-08-03std::rt: Run local storage cleanup and the box annihilator inside the try/catchBrian Anderson-27/+22
And before collect_failure. These are both running user dtors and need to be handled in the task try/catch block and before the final task cleanup code.
2013-08-02auto merge of #8195 : bblum/rust/task-cleanup, r=brsonbors-2/+7
In the first commit it is obvious why some of the barriers can be changed to ```Relaxed```, but it is not as obvious for the once I changed in ```kill.rs```. The rationale for those is documented as part of the documenting commit. Also the last commit is a temporary hack to prevent kill signals from being received in taskgroup cleanup code, which could be fixed in a more principled way once the old runtime is gone.
2013-08-01modified local to include an implementation for try_unsafe_borrow::<Task> so ↵toddaaro-0/+1
that the log methods will work
2013-08-01fixed incorrect handling of returned scheduler option and restructed ↵toddaaro-2/+2
scheduler functions slightly
2013-08-01minor tweaks - unboxed the coroutine so that it is no longer a ~ pointer ↵toddaaro-6/+6
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-01A major refactoring that changes the way the runtime uses TLS. In thetoddaaro-54/+161
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-01Temporary workaround to prevent taskgroup cleanup code from failing without ↵Ben Blum-2/+7
an exception handler.
2013-07-31Give tasks useful names. #2891Ben Blum-3/+7
2013-07-30std::rt: Use 2MB stacksBrian Anderson-1/+1
Seems to be around the minimum needed by rustc without split stacks
2013-07-26Consolidate raw representations of rust valuesAlex Crichton-1/+1
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-20Rename TCB to TaskgroupBen Blum-2/+2
2013-07-20Replace *rust_task ptrs in taskgroup code with TaskHandle, for transitioning ↵Ben Blum-0/+5
to newsched killing.
2013-07-20Remove join_latchBen Blum-4/+0
2013-07-20Add kill::Death for task death services and use it in Task.Ben Blum-17/+7
2013-07-16Rename Option swap_unwrap to take_unwrap. Fixes Issue#7764Austin King-1/+1
2013-07-14Make TLS keys actually take up spaceAlex Crichton-2/+2
If the TLS key is 0-sized, then the linux linker is apparently smart enough to put everything at the same pointer. OSX on the other hand, will reserve some space for all of them. To get around this, the TLS key now actuall consumes space to ensure that it gets a unique pointer
2013-07-14Purge the last remnants of the old TLS apiAlex Crichton-8/+6
Closes #3273
2013-07-11auto merge of #7677 : alexcrichton/rust/tls-gc, r=pcwaltonbors-6/+6
cc #6004 and #3273 This is a rewrite of TLS to get towards not requiring `@` when using task local storage. Most of the rewrite is straightforward, although there are two caveats: 1. Changing `local_set` to not require `@` is blocked on #7673 2. The code in `local_pop` is some of the most unsafe code I've written. A second set of eyes should definitely scrutinize it... The public-facing interface currently hasn't changed, although it will have to change because `local_data::get` cannot return `Option<T>`, nor can it return `Option<&T>` (the lifetime isn't known). This will have to be changed to be given a closure which yield `&T` (or as an Option). I didn't do this part of the api rewrite in this pull request as I figured that it could wait until when `@` is fully removed. This also doesn't deal with the issue of using something other than functions as keys, but I'm looking into using static slices (as mentioned in the issues).
2013-07-11Remove all external requirements of `@` from TLSAlex Crichton-2/+2
Closes #6004
2013-07-11Work around stage0 to remove '@' requirements from TLSAlex Crichton-5/+5
2013-07-09Change the elements in the task-local map to be actual key-value pairsAlex Crichton-1/+1
2013-07-03Merge remote-tracking branch 'mozilla/master'Brian Anderson-1/+1
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-02A missing ! made it so that the testcase schedule_home_states was throwing ↵toddaaro-1/+1
spurious assert failures. Why this did not result in the test case failing previously is beyond me.
2013-07-01Refactored the runtime to view coroutines as a component of tasks, instead ↵toddaaro-10/+166
of tasks as a component of coroutines.
2013-06-25Change finalize -> drop.Luqman Aden-1/+1
2013-06-24std: Make unlinking and task notification work with newschedBrian Anderson-0/+25
2013-06-24std: Make box annihilator work with newschedBrian Anderson-0/+21
2013-06-20std: Port SharedChan to newschedBrian Anderson-0/+12
2013-06-16Merge remote-tracking branch 'brson/io'Brian Anderson-15/+45
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-19/+41
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-15std::rt: Tasks contain a JoinLatchBrian Anderson-1/+32
2013-06-14redesigned the pinning to pin deal with things on dequeue, not on enqueuetoddaaro-3/+11
2013-06-13std::rt: Tasks must have an unwinder. SimplerBrian Anderson-35/+4
2013-06-13std::rt: Change the Task constructors to reflect a treeBrian Anderson-2/+24