about summary refs log tree commit diff
path: root/src/libstd/rt/kill.rs
AgeCommit message (Collapse)AuthorLines
2013-12-24green: Rip the bandaid off, introduce libgreenAlex Crichton-318/+0
This extracts everything related to green scheduling from libstd and introduces a new libgreen crate. This mostly involves deleting most of std::rt and moving it to libgreen. Along with the movement of code, this commit rearchitects many functions in the scheduler in order to adapt to the fact that Local::take now *only* works on a Task, not a scheduler. This mostly just involved threading the current green task through in a few locations, but there were one or two spots where things got hairy. There are a few repercussions of this commit: * tube/rc have been removed (the runtime implementation of rc) * There is no longer a "single threaded" spawning mode for tasks. This is now encompassed by 1:1 scheduling + communication. Convenience methods have been introduced that are specific to libgreen to assist in the spawning of pools of schedulers.
2013-12-16Fallout of rewriting std::commAlex Crichton-14/+23
2013-12-10libextra: Another round of de-`Cell`-ing.Patrick Walton-3/+4
34 uses of `Cell` remain.
2013-11-26libstd: Remove all non-`proc` uses of `do` from libstdPatrick Walton-4/+1
2013-11-24Remove linked failure from the runtimeAlex Crichton-713/+30
The reasons for doing this are: * The model on which linked failure is based is inherently complex * The implementation is also very complex, and there are few remaining who fully understand the implementation * There are existing race conditions in the core context switching function of the scheduler, and possibly others. * It's unclear whether this model of linked failure maps well to a 1:1 threading model Linked failure is often a desired aspect of tasks, but we would like to take a much more conservative approach in re-implementing linked failure if at all. Closes #8674 Closes #8318 Closes #8863
2013-11-19libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstdPatrick Walton-4/+3
2013-11-18libstd: Change all `~fn()`s to `proc`s in the standard library.Patrick Walton-4/+5
This makes `Cell`s no longer necessary in most cases.
2013-11-01Remove unnecessary unwind messagesAlex Crichton-2/+2
Now that the type_id intrinsic is working across crates, all of these unnecessary messages can be removed to have the failure type for a task truly be ~Any and only ~Any
2013-10-30Prepared `std::sys` for removal, and made `begin_unwind` simplerMarvin Löbel-2/+2
- `begin_unwind` is now generic over any `T: Any + Send`. - Every value you fail with gets boxed as an `~Any`. - Because of implementation details, `&'static str` and `~str` are still handled specially behind the scenes. - Changed the big macro source string in libsyntax to a raw string literal, and enabled doc comments there.
2013-10-28Allow fail messages to be caught, and introduce the Any traitMarvin Löbel-11/+23
Some code cleanup, sorting of import blocks Removed std::unstable::UnsafeArc's use of Either Added run-fail tests for the new FailWithCause impls Changed future_result and try to return Result<(), ~Any>. - Internally, there is an enum of possible fail messages passend around. - In case of linked failure or a string message, the ~Any gets lazyly allocated in future_results recv method. - For that, future result now returns a wrapper around a Port. - Moved and renamed task::TaskResult into rt::task::UnwindResult and made it an internal enum. - Introduced a replacement typedef `type TaskResult = Result<(), ~Any>`.
2013-10-23Removed Unnecessary comments and white spaces #4386reedlepee-7/+6
2013-10-23Making fields in std and extra : private #4386reedlepee-6/+7
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-4/+4
Who doesn't like a massive renaming?
2013-10-09option: rewrite the API to use compositionDaniel Micay-7/+7
2013-09-30std: Remove usage of fmt!Alex Crichton-5/+5
2013-09-25rustdoc: Change all code-blocks with a scriptAlex Crichton-2/+2
find src -name '*.rs' | xargs sed -i '' 's/~~~.*{\.rust}/```rust/g' find src -name '*.rs' | xargs sed -i '' 's/ ~~~$/ ```/g' find src -name '*.rs' | xargs sed -i '' 's/^~~~$/ ```/g'
2013-09-16switch Drop to `&mut self`Daniel Micay-2/+2
2013-08-27auto merge of #8790 : huonw/rust/unsafearc, r=thestingerbors-7/+7
`UnsafeAtomicRcBox` &rarr; `UnsafeArc` (#7674), and `AtomicRcBoxData` &rarr; `ArcData` to reflect this. Also, the inner pointer of `UnsafeArc` is now `*mut ArcData`, which avoids some transmutes to `~`: i.e. less chance of mistakes.
2013-08-27Rename UnsafeAtomicRcBox to UnsafeArc. Fixes #7674.Huon Wilson-7/+7
2013-08-27Decrement unkillable counter before failingFlaper Fesp-1/+3
2013-08-27Don't make the runtime exit on illegal callsFlaper Fesp-1/+3
2013-08-23Document the task watching / exit code propagation implementation.Ben Blum-1/+85
2013-08-16Reserve 'yield' keywordKevin Ballard-5/+5
Rename task::yield() to task::deschedule(). Fixes #8494.
2013-08-12Clean up transitionary glue in task/spawn.rs. Don't hold kill-little-lock ↵Ben Blum-2/+2
for O(n) time, cf #3100, and optimize out several unneeded clone()s.
2013-08-10std: Rename Iterator.transform -> .mapErick Tryzelaar-1/+1
cc #5898
2013-08-10Mass rename of .consume{,_iter}() to .move_iter()Erick Tryzelaar-1/+1
cc #7887
2013-08-08auto merge of #8385 : cmr/rust/big-rollup, r=alexcrichtonbors-1/+2
This is a fairly large rollup, but I've tested everything locally, and none of it should be platform-specific. r=alexcrichton (bdfdbdd) r=brson (d803c18) r=alexcrichton (a5041d0) r=bstrie (317412a) r=alexcrichton (135c85e) r=thestinger (8805baa) r=pcwalton (0661178) r=cmr (9397fe0) r=cmr (caa4135) r=cmr (6a21d93) r=cmr (4dc3379) r=cmr (0aa5154) r=cmr (18be261) r=thestinger (f10be03)
2013-08-07(cleanup) Improve rtabort message for atomic-sleep.Ben Blum-1/+2
2013-08-07Disable linked failure testsBrian Anderson-0/+6
The implementation currently contains a race that leads to segfaults.
2013-08-07std: removed option.take_map{,_default}Erick Tryzelaar-5/+5
2013-08-07core: option.map_consume -> option.map_moveErick Tryzelaar-2/+2
2013-08-05Lazily initialize 'leaf node' taskgroups for unlinked spawns, for an ↵Ben Blum-0/+4
apparent 11% speedup.
2013-08-05(cleanup) Uncomment an assertion that now holds.Ben Blum-5/+4
2013-08-02Don't fail from kill signals if already unwinding.Ben Blum-2/+2
2013-08-02Fix embarrassing bug where 'unkillable' would unwind improperly when it ↵Ben Blum-2/+3
receives a kill signal.
2013-08-01Temporary workaround to prevent taskgroup cleanup code from failing without ↵Ben Blum-1/+6
an exception handler.
2013-08-01Document task killing design and relaxed barrier rationale.Ben Blum-1/+57
2013-08-01Relax some atomic barriers. Loosen up all that tension. There, doesn't that ↵Ben Blum-10/+13
feel good?
2013-07-31Move atomically to unstable::sync, and document what it actually does. Close ↵Ben Blum-1/+1
#7872.
2013-07-30UnsafeArc methods return unsafe pointers, so are not themselves unsafe.Ben Blum-10/+10
2013-07-30Implement select() for new runtime pipes.Ben Blum-3/+30
2013-07-27Change concurrency primitives to standard naming conventionsSteven Stewart-Gallus-2/+2
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-20Add watched and indestructible spawn modes.Ben Blum-1/+1
2013-07-20Replace *rust_task ptrs in taskgroup code with TaskHandle, for transitioning ↵Ben Blum-0/+12
to newsched killing.
2013-07-20Stash a spare kill flag inside tasks, to save two atomic xadds in the ↵Ben Blum-37/+75
blocking fastpath.
2013-07-20Add tests for task killing and blocking.Ben Blum-0/+140
2013-07-20Add BlockedTask (wake, try_block, etc) in kill.rs.Ben Blum-2/+95
2013-07-20Do a task-killed check at the start of task 'timeslices'.Ben Blum-1/+27
2013-07-20Implement KillHandle::kill() and friends (unkillable, atomically). Close #6377.Ben Blum-2/+150
2013-07-20Add tests for KillHandleBen Blum-0/+140