about summary refs log tree commit diff
path: root/src/libstd/task/spawn.rs
AgeCommit message (Collapse)AuthorLines
2013-08-23auto merge of #8677 : bblum/rust/scratch, r=alexcrichtonbors-45/+32
r anybody; there isn't anything complicated here
2013-08-22Enabled unit tests in std and extra.Vadim Chugunov-3/+0
2013-08-20small cleanups in task/spawn.rsBen Blum-45/+32
2013-08-12Clean up transitionary glue in task/spawn.rs. Don't hold kill-little-lock ↵Ben Blum-129/+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-127/+16
2013-08-09std: Fix perf of local allocations in newschedBrian Anderson-9/+8
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-07std: Allow spawners to specify stack sizeBrian Anderson-7/+7
2013-08-07core: option.map_consume -> option.map_moveErick Tryzelaar-3/+3
2013-08-05Lazily initialize 'leaf node' taskgroups for unlinked spawns, for an ↵Ben Blum-45/+59
apparent 11% speedup.
2013-08-03remove obsolete `foreach` keywordDaniel Micay-5/+5
this has been replaced by `for`
2013-08-02std: Implement SingleThreaded spawn mode for newschedBrian Anderson-8/+80
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: 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-0/+2
r? @brson
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-5/+4
2013-07-31Give tasks useful names. #2891Ben Blum-0/+2
2013-07-31auto merge of #8139 : brson/rust/rm-old-task-apis, r=pcwaltonbors-32/+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-7/+3
2013-07-30std: Remove CurrentScheduler spawn mode. UnusedBrian Anderson-11/+2
2013-07-30std: Remove ExistingScheduler spawn mode. UnusedBrian Anderson-4/+1
2013-07-30std: Remove PlatformThread spawn mode. ObsoleteBrian Anderson-4/+2
2013-07-30std: Remove ThreadPerTask spawn mode. UnimplementedBrian Anderson-4/+1
2013-07-30std: Remove ManualThreads spawn modeBrian Anderson-7/+1
2013-07-30Unkillable is not unsafe. Close #7832.Ben Blum-1/+1
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-5/+5
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-22new snapshotDaniel Micay-5/+0
2013-07-20Add watched and indestructible spawn modes.Ben Blum-3/+10
2013-07-20Rename TCB to TaskgroupBen Blum-13/+14
2013-07-20Enable taskgroup code for newsched spawns.Ben Blum-3/+28
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
2013-07-20Replace *rust_task ptrs in taskgroup code with TaskHandle, for transitioning ↵Ben Blum-128/+202
to newsched killing.
2013-07-20Add kill::Death for task death services and use it in Task.Ben Blum-1/+1
2013-07-18auto merge of #7856 : brson/rust/no-thread-per-core, r=pcwaltonbors-2/+1
This doesn't make sense under the new scheduler.
2013-07-16Rename Option swap_unwrap to take_unwrap. Fixes Issue#7764Austin King-3/+3
2013-07-14Make TLS keys actually take up spaceAlex Crichton-7/+12
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-13Split mutable methods out of Set and MapSteven Fackler-1/+1
Fixes most of #4989. I didn't add Persistent{Set,Map} since the only persistent data structure is fun_treemap and its functionality is currently too limited to build a trait out of.
2013-07-11auto merge of #7677 : alexcrichton/rust/tls-gc, r=pcwaltonbors-19/+21
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-09std: Remove ThreadPerCore spawn mode. UnusedBrian Anderson-2/+1
2013-07-09Change TLS to almost be able to contain owned typesAlex Crichton-19/+21
2013-07-03Merge remote-tracking branch 'mozilla/master'Brian Anderson-10/+12
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-01Refactored the runtime to view coroutines as a component of tasks, instead ↵toddaaro-8/+19
of tasks as a component of coroutines.
2013-06-29Removing a lot of usage of '&const'Alex Crichton-1/+1
2013-06-29'Borrow' stack closures rather than copying them (e.g., "|x|f(x)"), in prep ↵Ben Blum-0/+4
for making them noncopyable.
2013-06-28libextra: Fix even more merge fallout.Patrick Walton-1/+0
2013-06-28librustc: Disallow "mut" from distributing over bindings.Patrick Walton-1/+3
This is the backwards-incompatible part of per-binding-site "mut".