summary refs log tree commit diff
path: root/src/libstd/rt/task.rs
AgeCommit message (Collapse)AuthorLines
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
2013-06-13automated whitespace fixesDaniel Micay-1/+0
2013-06-10debugged a compiler ICE when merging local::borrow changes into the main io ↵toddaaro-2/+2
branch and modified the incoming new file lang.rs to be api-compatible
2013-06-02ptr: split out borrowed pointer utilitiesDaniel Micay-2/+3
The ptr module is intended to be for raw pointers. Closes #3111
2013-05-30Remove unnecessary 'use' formsDaniel Farina-1/+0
Fix a laundry list of warnings involving unused imports that glutted up compilation output. There are more, but there seems to be some false positives (where 'remedy' appears to break the build), but this particular set of fixes seems safe.
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-3/+5
2013-05-23cleanup warnings from libstdErick Tryzelaar-1/+0
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-0/+230
This only changes the directory names; it does not change the "real" metadata names.