summary refs log tree commit diff
path: root/src/libstd/rt
AgeCommit message (Collapse)AuthorLines
2013-08-12Clean up transitionary glue in task/spawn.rs. Don't hold kill-little-lock ↵Ben Blum-8/+6
for O(n) time, cf #3100, and optimize out several unneeded clone()s.
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-313/+23
Pending #8215.
2013-08-10std: Rename Iterator.transform -> .mapErick Tryzelaar-1/+1
cc #5898
2013-08-10std: merge Iterator and IteratorUtilErick Tryzelaar-2/+1
2013-08-10Mass rename of .consume{,_iter}() to .move_iter()Erick Tryzelaar-6/+6
cc #7887
2013-08-09auto merge of #8296 : erickt/rust/remove-str-trailing-nulls, r=ericktbors-23/+25
This PR fixes #7235 and #3371, which removes trailing nulls from `str` types. Instead, it replaces the creation of c strings with a new type, `std::c_str::CString`, which wraps a malloced byte array, and respects: * No interior nulls * Ends with a trailing null
2013-08-09Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-99/+424
remove-str-trailing-nulls
2013-08-09auto merge of #8387 : brson/rust/nooldrt, r=brsonbors-154/+17
2013-08-09Remove the C++ runtime. SayonaraBrian Anderson-154/+17
2013-08-09auto merge of #8415 : brson/rust/newrt-local-heap-perf, r=pcwalton,brsonbors-28/+49
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-09Fix Ipv6Addr to_str for ::1:x.x.x.x addressesStepan Koltsov-1/+8
Reported by luqmana@
2013-08-09std: Fix perf of local allocations in newschedBrian Anderson-28/+49
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-08Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-124/+281
remove-str-trailing-nulls
2013-08-08auto merge of #8336 : stepancheg/rust/socket-addr-from-str, r=brsonbors-70/+367
FromStr implemented from scratch. It is overengineered a bit, however. Old implementation handles errors by fail!()-ing. And it has bugs, like it accepts `127.0.0.1::127.0.0.1` as IPv6 address, and does not handle all ipv4-in-ipv6 schemes. So I decided to implement parser from scratch.
2013-08-08auto merge of #8356 : toddaaro/rust/ws, r=brsonbors-62/+156
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-08auto merge of #8385 : cmr/rust/big-rollup, r=alexcrichtonbors-8/+28
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-08Enabled workstealing in the scheduler. Previously we had one global work ↵toddaaro-62/+156
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-08auto merge of #8245 : alexcrichton/rust/fmt2, r=graydonbors-1/+1
This is a reopening of #8182, although this removes any abuse of the compiler internals. Now it's just a pure syntax extension (hard coded what the attribute names are).
2013-08-07(cleanup) Improve rtabort message for atomic-sleep.Ben Blum-1/+2
2013-08-07fix recv_ready for Port to take &self and not need to return a tuple. Close ↵Ben Blum-7/+26
#8192.
2013-08-07Add initial support for a new formatting syntaxAlex Crichton-1/+1
The new macro is available under the name ifmt! (only an intermediate name)
2013-08-07Disable linked failure testsBrian Anderson-0/+6
The implementation currently contains a race that leads to segfaults.
2013-08-07std: Allow spawners to specify stack sizeBrian Anderson-38/+46
2013-08-07std::rt: Pull RUST_MIN_STACK from the environmentBrian Anderson-3/+32
2013-08-07std::rt: 2MB stacks againBrian Anderson-1/+1
2013-08-07std: removed option.take_map{,_default}Erick Tryzelaar-5/+5
2013-08-07core: option.map_consume -> option.map_moveErick Tryzelaar-6/+6
2013-08-07std: add result.map_move, result.map_err_moveErick Tryzelaar-2/+2
2013-08-06Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-19/+56
remove-str-trailing-nulls
2013-08-06Merge commit 'd89ff7eef969aee6b493bc846b64d68358fafbcd' into ↵Erick Tryzelaar-63/+104
remove-str-trailing-nulls
2013-08-06auto merge of #8317 : bblum/rust/fast-spawn-unlinked, r=brsonbors-5/+8
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-06Use FromStr for IpAddr in rt::uv::netStepan Koltsov-70/+2
2013-08-06auto merge of #8313 : msullivan/rust/cleanup, r=catamorphismbors-1/+1
2013-08-06Implement FromStr for IpAddr and SocketAddrStepan Koltsov-0/+365
Better than that in rt::uv::net, because it: * handles invalid input explicitly, without fail!() * parses socket address, not just IP * handles various ipv4-in-ipv6 addresses, like 2001:db8:122:344::192.0.2.33 (see http://tools.ietf.org/html/rfc6052 for example) * rejects output like `127.0000000.0.1` * does not allocate heap memory * have unit tests
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-05Updated std::Option, std::Either and std::ResultMarvin Löbel-13/+47
- 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-05Get rid of some NOTEs.Michael Sullivan-1/+1
2013-08-05auto merge of #8303 : brson/rust/tls-magic-wtf, r=brsonbors-0/+13
2013-08-05std::rt: Use magic to make TLS work from annihilated boxes. #8302Brian Anderson-0/+13
2013-08-04std::rt: Schedule more scheduler callbacks to avoid dropping messagesBrian Anderson-1/+3
2013-08-04std: Fix newsched logging truncationBrian Anderson-4/+17
The truncation needs to be done in the console logger in order to catch all the logging output, and because truncation only matters when outputting to the console.
2013-08-04Merge remote-tracking branch 'remotes/origin/master' into str-remove-nullErick Tryzelaar-206/+195
2013-08-04std::rt: Remove the test for context()Brian Anderson-10/+0
This is no longer testable once newsched is turned on
2013-08-04std::rt: Don't allow schedulers to exit before handling all messagesBrian Anderson-0/+10
Every time run_sched_once performs a 'scheduling action' it needs to guarantee that it runs at least one more time, so enqueue another run_sched_once callback. The primary reason it needs to do this is because not all async callbacks are guaranteed to run, it's only guaranteed that *a* callback will run after enqueing one - some may get dropped. At the moment this means we wastefully create lots of callbacks to ensure that there will *definitely* be a callback queued up to continue running the scheduler. The logic really needs to be tightened up here.
2013-08-04std::rt: 3MB stacks!Brian Anderson-2/+2
rustc needs *even more* megabytes when run without optimizations
2013-08-04std::rt: Run the tests for Local in a bare threadBrian Anderson-36/+45
Otherwise interferes with the existing runtime
2013-08-04std::rt: Improve the error message when the thread-local ptr is nullBrian Anderson-11/+15
Also fix some incorrect comments and variable names.
2013-08-04std: replace str::as_c_str with std::c_strErick Tryzelaar-20/+22