about summary refs log tree commit diff
path: root/src/libstd/rt
AgeCommit message (Collapse)AuthorLines
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
2013-08-04std: minor cleanupErick Tryzelaar-3/+3
2013-08-04auto merge of #8243 : stepancheg/rust/ipv, r=brsonbors-148/+142
multicast functions now take IpAddr (without port), because they dont't need port. Uv* types renamed: * UvIpAddr -> UvSocketAddr * UvIpv4 -> UvIpv4SocketAddr * UvIpv6 -> UvIpv6SocketAddr "Socket address" is a common name for (ip-address, port) pair (e.g. in sockaddr_in struct). P. S. Are there any backward compatibility concerns? What is std::rt module, is it a part of public API?
2013-08-03auto merge of #8264 : thestinger/rust/snapshot, r=Aatchbors-31/+31
2013-08-03remove obsolete `foreach` keywordDaniel Micay-31/+31
this has been replaced by `for`
2013-08-03std::rt: Run local storage cleanup and the box annihilator inside the try/catchBrian Anderson-27/+22
And before collect_failure. These are both running user dtors and need to be handled in the task try/catch block and before the final task cleanup code.
2013-08-03auto merge of #8213 : kballard/rust/fd-limit, r=brsonbors-4/+83
Revert the workaround 49b72bd and instead bump the fd limit on OS X.
2013-08-02librustc: Disallow "unsafe" for external functionsPatrick Walton-4/+4
2013-08-02Bump fd limit on macos when running rt testsKevin Ballard-0/+78
OS X defaults the ulimit for open files to 256 for programs launched from the Terminal (GUI apps get a higher default). Unfortunately this is too low for the rt tests, which deliberately overcommit and create a lot of threads (which means a lot of schedulers, and each scheduler needs at least 2 fds). By calling sysctl() and setrlimit() we can bump the fd limit up to the maximum allowed (on stock OS X it's 10240). Fixes #7772.
2013-08-02Revert "std::rt: Use a constant 4 threads for multithreaded sched tests"Kevin Ballard-4/+5
This workaround was less than ideal. A better solution is to raise the fd limit. This reverts commit 49b72bdd77916e27aaf95909516702c1450f11ac.
2013-08-03Rename IpAddr -> SocketAddr, extract IpAddr from SocketAddrStepan Koltsov-148/+142
multicast functions now take IpAddr (without port), because they dont't need port. Uv* types renamed: * UvIpAddr -> UvSocketAddr * UvIpv4 -> UvIpv4SocketAddr * UvIpv6 -> UvIpv6SocketAddr "Socket address" is a common name for (ip-address, port) pair (e.g. in sockaddr_in struct).
2013-08-02Add an assert_may_sleep() check on every context switch.Ben Blum-0/+4
2013-08-02Don't fail from kill signals if already unwinding.Ben Blum-3/+3
2013-08-02Fix embarrassing bug where 'unkillable' would unwind improperly when it ↵Ben Blum-2/+3
receives a kill signal.
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 #8221 : brson/rust/single-threaded, r=graydonbors-3/+9
This is the last major runtime feature needed for the transition to the new scheduler.
2013-08-02auto merge of #8195 : bblum/rust/task-cleanup, r=brsonbors-23/+90
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-02std: Implement SingleThreaded spawn mode for newschedBrian Anderson-3/+9
2013-08-02replace `range` with an external iteratorDaniel Micay-25/+23
2013-08-01modified local to include an implementation for try_unsafe_borrow::<Task> so ↵toddaaro-4/+11
that the log methods will work
2013-08-01fixed incorrect handling of returned scheduler option and restructed ↵toddaaro-75/+64
scheduler functions slightly
2013-08-01minor tweaks - unboxed the coroutine so that it is no longer a ~ pointer ↵toddaaro-32/+72
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-01Fixed a race where a scheduler configured to only run tasks pinned to it ↵toddaaro-8/+35
would "bounch" a regular task in and out of the work queue without allowing a different scheduler to run it.
2013-08-01A major refactoring that changes the way the runtime uses TLS. In thetoddaaro-987/+867
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-01Temporary workaround to prevent taskgroup cleanup code from failing without ↵Ben Blum-3/+13
an exception handler.
2013-08-01Make a forgotten assert in comm be cfg(test)-dependentBen Blum-3/+1
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-16/+19
feel good?
2013-08-01migrate to foreachDaniel Micay-2/+2
2013-08-01std: Change `Times` trait to use `do` instead of `for`blake2-ppc-27/+27
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-08-01auto merge of #8158 : bblum/rust/task-cleanup, r=brsonbors-4/+10
r? @brson
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-17/+18
2013-08-01make `in` and `foreach` get treated as keywordsDaniel Micay-14/+14
2013-07-31Move atomically to unstable::sync, and document what it actually does. Close ↵Ben Blum-1/+1
#7872.
2013-07-31Give tasks useful names. #2891Ben Blum-3/+9
2013-07-31auto merge of #8139 : brson/rust/rm-old-task-apis, r=pcwaltonbors-26/+55
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-30auto merge of #8008 : bblum/rust/select, r=brsonbors-100/+557
Main logic in ```Implement select() for new runtime pipes.```. The guts of the ```PortOne::try_recv()``` implementation are now split up across several functions, ```optimistic_check```, ```block_on```, and ```recv_ready```. There is one weird FIXME I left open here, in the "implement select" commit -- an assertion I couldn't get to work in the receive path, on an invariant that for some reason doesn't hold with ```SharedPort```. Still investigating this.
2013-07-30std::rt: Change Thread interface to require an explicit joinBrian Anderson-25/+54
Makes it more obvious what's going on