summary refs log tree commit diff
path: root/src/libstd/rt/comm.rs
AgeCommit message (Collapse)AuthorLines
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?
2013-08-01std: Change `Times` trait to use `do` instead of `for`blake2-ppc-19/+19
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-07-31auto merge of #8139 : brson/rust/rm-old-task-apis, r=pcwaltonbors-7/+14
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::rt: Change Thread interface to require an explicit joinBrian Anderson-7/+14
Makes it more obvious what's going on
2013-07-30Add a better-for-testing optimistic_check() for pipes with cfg(test).Ben Blum-1/+15
2013-07-30Implement select() for new runtime pipes.Ben Blum-32/+134
2013-07-29Optimize try_recv to not require the two context switches when data is ↵Ben Blum-31/+34
available.
2013-07-29Remove ChanOneHack/PortOneHack extra allocationBen Blum-50/+30
2013-07-20auto merge of #7910 : brson/rust/rm-fixme, r=graydonbors-5/+0
2013-07-20Enable taskgroup code for newsched spawns.Ben Blum-2/+8
2013-07-20Change the HOF context switchers to pass a BlockedTask instead of a ~Task.Ben Blum-14/+18
2013-07-19std::rt: Remove an obsolete FIXME. #7757Brian Anderson-5/+0
2013-07-03Merge remote-tracking branch 'mozilla/master'Brian Anderson-15/+15
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-4/+8
of tasks as a component of coroutines.
2013-06-28librustc: Change "Owned" to "Send" everywherePatrick Walton-5/+5
2013-06-25Change finalize -> drop.Luqman Aden-2/+2
2013-06-24std: Make box annihilator work with newschedBrian Anderson-12/+0
2013-06-16Merge remote-tracking branch 'brson/io'Brian Anderson-19/+322
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-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-06std::rt: Fix stream test to be parallelBrian Anderson-4/+4
2013-06-06std: Fix stage0 buildBrian Anderson-0/+12
Conflicts: src/libstd/rt/comm.rs
2013-06-05core::rt: Add `MegaPipe`, an unbounded, multiple producer/consumer, ↵Brian Anderson-0/+71
lock-free queue
2013-06-05core::rt: Add SharedPortBrian Anderson-0/+132
2013-06-05core::rt: Implement SharedChanBrian Anderson-3/+64