about summary refs log tree commit diff
path: root/src/libstd/rt/comm.rs
AgeCommit message (Collapse)AuthorLines
2013-12-16Fallout of rewriting std::commAlex Crichton-1141/+0
2013-12-11Make 'self lifetime illegal.Erik Price-4/+4
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-10libstd: Change `atomically` to use RAII.Patrick Walton-11/+7
2013-12-10librustuv: RAII-ify `Local::borrow`, and remove some 12 Cells.Patrick Walton-8/+5
2013-12-10libextra: Another round of de-`Cell`-ing.Patrick Walton-35/+17
34 uses of `Cell` remain.
2013-11-26librustc: Fix merge fallout.Patrick Walton-2/+2
2013-11-26test: Remove non-procedure uses of `do` from compiletest, libstd tests,Patrick Walton-9/+9
compile-fail tests, run-fail tests, and run-pass tests.
2013-11-26libstd: Remove all non-`proc` uses of `do` from libstdPatrick Walton-50/+50
2013-11-23Move mutable::Mut to cell::RefCellSteven Fackler-8/+7
2013-11-22Change Mut::map to Mut::withSteven Fackler-3/+3
2013-11-22Cell -> Mut switch in commSteven Fackler-20/+24
2013-10-30auto merge of #10168 : reedlepee123/rust/priv_fields, r=brsonbors-21/+21
....rs #8180
2013-10-30changed all the impl<T> to impl<T: Send> in rt::comm.rs and libstd::comm.rs ↵reedlepee-21/+21
#8180
2013-10-29auto merge of #10140 : brson/rust/comm, r=alexcrichtonbors-7/+1
Just putting this public trait into the correct module.
2013-10-28std: Move the SendDeferred trait to std::commBrian Anderson-7/+1
2013-10-28Register new snapshotsAlex Crichton-23/+17
2013-10-23auto merge of #9810 : huonw/rust/rand3, r=alexcrichtonbors-1/+1
- Adds the `Sample` and `IndependentSample` traits for generating numbers where there are parameters (e.g. a list of elements to draw from, or the mean/variance of a normal distribution). The former takes `&mut self` and the latter takes `&self` (this is the only difference). - Adds proper `Normal` and `Exp`-onential distributions - Adds `Range` which generates `[lo, hi)` generically & properly (via a new trait) replacing the incorrect behaviour of `Rng.gen_integer_range` (this has become `Rng.gen_range` for convenience, it's far more efficient to use `Range` itself) - Move the `Weighted` struct from `std::rand` to `std::rand::distributions` & improve it - optimisations and docs
2013-10-23std::rand: add distributions::Range for generating [lo, hi).Huon Wilson-1/+1
This reifies the computations required for uniformity done by (the old) `Rng.gen_integer_range` (now Rng.gen_range), so that they can be amortised over many invocations, if it is called in a loop. Also, it makes it correct, but using a trait + impls for each type, rather than trying to coerce `Int` + `u64` to do the right thing. This also makes it more extensible, e.g. big integers could & should implement SampleRange.
2013-10-23Removed Unnecessary comments and white spaces #4386reedlepee-6/+0
2013-10-23Making fields in std and extra : private #4386reedlepee-4/+10
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-3/+3
Who doesn't like a massive renaming?
2013-10-09option: rewrite the API to use compositionDaniel Micay-3/+3
2013-09-30std: Remove usage of fmt!Alex Crichton-4/+4
2013-09-25std::rt: Implement task yielding. Fix a starvation problemBrian Anderson-0/+11
2013-09-23std: merge rand::{Rng,RngUtil} with default methods.Huon Wilson-2/+2
Also, documentation & general clean-up: - remove `gen_char_from`: better served by `sample` or `choose`. - `gen_bytes` generalised to `gen_vec`. - `gen_int_range`/`gen_uint_range` merged into `gen_integer_range` and made to be properly uniformly distributed. Fixes #8644. Minor adjustments to other functions.
2013-09-16switch Drop to `&mut self`Daniel Micay-2/+2
2013-08-29Remove the iter module.Jason Fager-1/+1
Moves the Times trait to num while the question of whether it should exist at all gets hashed out as a completely separate question.
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-3/+3
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
2013-08-27Rename UnsafeAtomicRcBox to UnsafeArc. Fixes #7674.Huon Wilson-5/+5
2013-08-24std::rt: Remove metrics for perfBrian Anderson-10/+0
These aren't used for anything at the moment and cause some TLS hits on some perf-critical code paths. Will need to put better thought into it in the future.
2013-08-23std: Convert some assert!s to rtassert!Brian Anderson-4/+5
2013-08-23auto merge of #8677 : bblum/rust/scratch, r=alexcrichtonbors-6/+7
r anybody; there isn't anything complicated here
2013-08-21std/extra: changing XXX to FIXME; cleanupTim Chevalier-5/+4
* Get rid of by-value-self workarounds; it works now * Remove type annotations, they're not needed anymore
2013-08-21Don't fail in port.try_recv() the second time. Close #7800.Ben Blum-6/+7
2013-08-19Try to fix mac valgrind bot by disabling thread-heavy activities.Graydon Hoare-0/+10
2013-08-12Fix select() in light of the deschedule...and then race. Close #8347.Ben Blum-1/+3
2013-08-12Reorganise Select traits to not expose internal runtime types. Close #5160. ↵Ben Blum-6/+17
Pending #8215.
2013-08-09std: Fix perf of local allocations in newschedBrian Anderson-2/+2
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-08auto merge of #8356 : toddaaro/rust/ws, r=brsonbors-3/+4
This pull request converts the scheduler from a naive shared queue scheduler to a naive workstealing scheduler. The deque is still a queue inside a lock, but there is still a substantial performance gain. Fiddling with the messaging benchmark I got a ~10x speedup and observed massively reduced memory usage. There are still *many* locations for optimization, but based on my experience so far it is a clear performance win as it is now.
2013-08-08Enabled workstealing in the scheduler. Previously we had one global work ↵toddaaro-3/+4
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-07fix recv_ready for Port to take &self and not need to return a tuple. Close ↵Ben Blum-4/+25
#8192.
2013-08-07core: option.map_consume -> option.map_moveErick Tryzelaar-2/+2
2013-08-02Fix nasty double-free bug where a newrt chan could get killed after ↵Ben Blum-2/+7
rescheduling but before suppressing_finalize.
2013-08-02Add SendDeferred trait and use it to fix #8214.Ben Blum-24/+127
2013-08-02auto merge of #8195 : bblum/rust/task-cleanup, r=brsonbors-9/+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-01fixed incorrect handling of returned scheduler option and restructed ↵toddaaro-6/+2
scheduler functions slightly
2013-08-01minor tweaks - unboxed the coroutine so that it is no longer a ~ pointer ↵toddaaro-0/+4
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-2/+1
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-01Make a forgotten assert in comm be cfg(test)-dependentBen Blum-3/+1
2013-08-01Relax some atomic barriers. Loosen up all that tension. There, doesn't that ↵Ben Blum-6/+6
feel good?