about summary refs log tree commit diff
path: root/src/libstd/task
AgeCommit message (Collapse)AuthorLines
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-12/+15
2013-08-18auto merge of #8560 : kballard/rust/reserve-yield, r=pcwaltonbors-15/+15
Rename task::yield() to task::deschedule(). Fixes #8494.
2013-08-16Reserve 'yield' keywordKevin Ballard-15/+15
Rename task::yield() to task::deschedule(). Fixes #8494.
2013-08-16doc: correct spelling in documentation.Huon Wilson-3/+3
2013-08-12Clean up transitionary glue in task/spawn.rs. Don't hold kill-little-lock ↵Ben Blum-130/+63
for O(n) time, cf #3100, and optimize out several unneeded clone()s.
2013-08-10Mass rename of .consume{,_iter}() to .move_iter()Erick Tryzelaar-5/+5
cc #7887
2013-08-09Remove the C++ runtime. SayonaraBrian Anderson-307/+48
2013-08-09std: Fix perf of local allocations in newschedBrian Anderson-16/+16
Mostly optimizing TLS accesses to bring local heap allocation performance closer to that of oldsched. It's not completely at parity but removing the branches involved in supporting oldsched and optimizing pthread_get/setspecific to instead use our dedicated TCB slot will probably make up for it.
2013-08-08Enabled workstealing in the scheduler. Previously we had one global work ↵toddaaro-1/+8
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.
2013-08-07Disable linked failure testsBrian Anderson-0/+19
The implementation currently contains a race that leads to segfaults.
2013-08-07std: Allow spawners to specify stack sizeBrian Anderson-11/+15
2013-08-07core: option.map_consume -> option.map_moveErick Tryzelaar-3/+3
2013-08-06auto merge of #8317 : bblum/rust/fast-spawn-unlinked, r=brsonbors-45/+59
This lazily initializes the taskgroup structs for ```spawn_unlinked``` tasks. If such a task never spawns another task linked to it (or a descendant of it), its taskgroup is simply never initialized at all. Also if an unlinked task spawns another unlinked task, neither of them will need to initialize their taskgroups. This works for the main task too. I benchmarked this with the following test case and observed a ~~21% speedup (average over 4 runs: 7.85 sec -> 6.20 sec, 2.5 GHz)~~ 11% speedup, see comment below. ``` use std::task; use std::cell::Cell; use std::rt::comm; static NUM: uint = 1024*256; fn run(f: ~fn()) { let mut t = task::task(); t.unlinked(); t.spawn(f); } fn main() { do NUM.times { let (p,c) = comm::oneshot(); let c = Cell::new(c); do run { c.take().send(()); } p.recv(); } } ```
2013-08-05Lazily initialize 'leaf node' taskgroups for unlinked spawns, for an ↵Ben Blum-45/+59
apparent 11% speedup.
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-1/+1
- 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-03remove obsolete `foreach` keywordDaniel Micay-6/+6
this has been replaced by `for`
2013-08-02librustc: Disallow "unsafe" for external functionsPatrick Walton-6/+6
2013-08-02Fix embarrassing bug where 'unkillable' would unwind improperly when it ↵Ben Blum-0/+41
receives a kill signal.
2013-08-02std: Implement SingleThreaded spawn mode for newschedBrian Anderson-13/+98
2013-08-01modified local to include an implementation for try_unsafe_borrow::<Task> so ↵toddaaro-6/+6
that the log methods will work
2013-08-01Have linked failure tests run on the new scheduler instead of requiring ↵Ben Blum-79/+152
RUST_NEWRT to test.
2013-08-01A major refactoring that changes the way the runtime uses TLS. In thetoddaaro-30/+13
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-9/+9
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-08-01std: Replace `for` with `do { .. }` expr where internal iterators are usedblake2-ppc-1/+2
2013-08-01auto merge of #8158 : bblum/rust/task-cleanup, r=brsonbors-55/+59
r? @brson
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-6/+5
2013-07-31Move atomically to unstable::sync, and document what it actually does. Close ↵Ben Blum-53/+0
#7872.
2013-07-31Give tasks useful names. #2891Ben Blum-2/+59
2013-07-31auto merge of #8139 : brson/rust/rm-old-task-apis, r=pcwaltonbors-129/+5
This removes a bunch of options from the task builder interface that are irrelevant to the new scheduler and were generally unused anyway. It also bumps the stack size of new scheduler tasks so that there's enough room to run rustc and changes the interface to `Thread` to not implicitly join threads on destruction, but instead require an explicit, and mandatory, call to `join`.
2013-07-30std: Remove foreign_stack_size spawn option. Irrelevant to future FFI changesBrian Anderson-16/+3
2013-07-30std: Remove get_task function. UnusedBrian Anderson-15/+0
2013-07-30std: Remove CurrentScheduler spawn mode. UnusedBrian Anderson-13/+2
2013-07-30std: Remove ExistingScheduler spawn mode. UnusedBrian Anderson-17/+2
2013-07-30std: Remove PlatformThread spawn mode. ObsoleteBrian Anderson-22/+2
2013-07-30std: Remove ThreadPerTask spawn mode. UnimplementedBrian Anderson-6/+1
2013-07-30std: Remove ManualThreads spawn modeBrian Anderson-46/+1
2013-07-30Unkillable is not unsafe. Close #7832.Ben Blum-22/+24
2013-07-30(cleanup) Fix unimplemented message for kill_all in newsched.Ben Blum-2/+7
2013-07-27Change concurrency primitives to standard naming conventionsSteven Stewart-Gallus-6/+6
To be more specific: `UPPERCASETYPE` was changed to `UppercaseType` `type_new` was changed to `Type::new` `type_function(value)` was changed to `value.method()`
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-22new snapshotDaniel Micay-238/+0
2013-07-20librustc: Remove `pub extern` and `priv extern` from the language.Patrick Walton-28/+28
Place `pub` or `priv` on individual items instead.
2013-07-20Use Option .take() or .take_unwrap() instead of util::replace where possibleblake2-ppc-6/+5
2013-07-20Add watched and indestructible spawn modes.Ben Blum-3/+120
2013-07-20Rename TCB to TaskgroupBen Blum-13/+14
2013-07-20Enable taskgroup code for newsched spawns.Ben Blum-3/+28
2013-07-20Fix linked failure tests to block forever instead of looping around yield.Ben Blum-29/+13
2013-07-20(cleanup) impl TaskSetBen Blum-39/+39
2013-07-20(cleanup) Don't check taskgroup generation monotonicity unless cfg(test).Ben Blum-16/+16
2013-07-20(cleanup) Modernize taskgroup code for the new borrow-checker.Ben Blum-61/+20