summary refs log tree commit diff
path: root/src/libstd/rt
AgeCommit message (Collapse)AuthorLines
2013-08-21Adjust callbacks in the libraries for the new type of extern fnsNiko Matsakis-22/+112
cc #3678
2013-08-21auto merge of #8600 : sfackler/rust/http, r=brsonbors-30/+0
It's an empty stub and as one of the comments notes, doesn't belong in libstd.
2013-08-20auto merge of #8656 : toddaaro/rust/idle-opt+cleaning, r=brsonbors-14/+17
Fixed a memory leak caused by the singleton idle callback failing to close correctly. The problem was that the close function requires running inside a callback in the event loop, but we were trying to close the idle watcher after the loop returned from run. The fix was to just call run again to process this callback. There is an additional tweak to move the initialization logic fully into bootstrap, so tasks that do not ever call run do not have problems destructing.
2013-08-20auto merge of #8631 : anasazi/rust/homing-io, r=brsonbors-348/+679
libuv handles are tied to the event loop that created them. In order to perform IO, the handle must be on the thread with its home event loop. Thus, when as task wants to do IO it must first go to the IO handle's home event loop and pin itself to the corresponding scheduler while the IO action is in flight. Once the IO action completes, the task is unpinned and either returns to its home scheduler if it is a pinned task, or otherwise stays on the current scheduler. Making new blocking IO implementations (i.e. files) thread safe is rather simple. Add a home field to the IO handle's struct in uvio and implement the HomingIO trait. Wrap every IO call in the HomingIO.home_for_io method, which will take care of the scheduling. I'm not sure if this remains thread safe in the presence of asynchronous IO at the libuv level. If we decide to do that, then this set up should be revisited.
2013-08-20Fixed a memory leak caused by the singleton idle callback failing to close ↵toddaaro-14/+17
correctly. The problem was that the close function requires running inside a callback in the event loop, but we were trying to close the idle watcher after the loop returned from run. The fix was to just call run again to process this callback. There is an additional tweak to move the initialization logic fully into bootstrap, so tasks that do not ever call run do not have problems destructing.
2013-08-20auto merge of #8519 : msullivan/rust/objects, r=catamorphismbors-1/+1
r?
2013-08-20Added home_for_io_with_sched variant. Temporarily making IO unkillable.Eric Reed-124/+165
2013-08-20Add assert_once_ever macro. Close #7748. (fixme cf #8472)Ben Blum-0/+1
2013-08-20Moved .sleep() to Timer.Eric Reed-7/+2
2013-08-20auto merge of #8566 : toddaaro/rust/idle-opt+cleaning, r=catamorphism,brsonbors-302/+386
Instead of a furious storm of idle callbacks we just have one. This is a major performance gain - around 40% on my machine for the ping pong bench. Also in this PR is a cleanup commit for the scheduler code. Was previously up as a separate PR, but bors load + imminent merge hell led me to roll them together. Was #8549.
2013-08-19std: Restore dynamic borrow trackingBrian Anderson-12/+43
2013-08-19Make IO thread-safe.Eric Reed-660/+653
Each IO handle has a home event loop, which created it. When a task wants to use an IO handle, it must first make sure it is on that home event loop. It uses the scheduler handle in the IO handle to send itself there before starting the IO action. Once the IO action completes, the task restores its previous home state. If it is an AnySched task, then it will be executed on the new scheduler. If it has a normal home, then it will return there before executing any more code after the IO action.
2013-08-19Homed UDP socketsEric Reed-24/+213
2013-08-19Working homing UDP socket prototype.Eric Reed-1/+151
2013-08-19Instruct event loops to ignore SIGPIPE when constructed.Eric Reed-0/+1
libuv does not always catch SIGPIPE.
2013-08-19Do not execute the callback before cleaning up resources.Eric Reed-8/+6
2013-08-19Derive Clone for IpAddr and SocketAddrEric Reed-2/+2
2013-08-19Try to fix mac valgrind bot by disabling thread-heavy activities.Graydon Hoare-6/+48
2013-08-19clean whitespace :/toddaaro-6/+6
2013-08-19Rangechange the log message truncation limit.Michael Sullivan-1/+1
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-15/+254
2013-08-18Delete std::rt::io::net::httpSteven Fackler-30/+0
It's an empty stub and as one of the comments notes, doesn't belong in libstd.
2013-08-18auto merge of #8560 : kballard/rust/reserve-yield, r=pcwaltonbors-5/+5
Rename task::yield() to task::deschedule(). Fixes #8494.
2013-08-18auto merge of #8551 : huonw/rust/speling, r=alexcrichtonbors-22/+21
(This doesn't add/remove `u`s or change `ize` to `ise`, or anything like that.)
2013-08-18More spelling corrections.Huon Wilson-2/+2
2013-08-16A round of code cleaning for the primary scheduler code. Comments have been ↵toddaaro-275/+201
updated, a minor amount of support type restructing has happened, methods have been reordered, and some duplicate code has been purged.
2013-08-16Moved the logic for a pausible idle callback into a new type - ↵toddaaro-96/+103
PausibleIdleCallback and placed the appropriate signatures in rtio and implementation into uvio.
2013-08-16std::rt: Fix a race in UvRemoteCallback's dtor that misses callbacksBrian Anderson-7/+74
Full description in comments.
2013-08-16std::rt: Touch up idle logicBrian Anderson-16/+36
2013-08-16an attempt at a singleton pausible idle callback for each scheduler. suffers ↵toddaaro-19/+83
from nondeterministic deadlock and also pending scheduler messages on scheduler shutdown.
2013-08-16Reserve 'yield' keywordKevin Ballard-5/+5
Rename task::yield() to task::deschedule(). Fixes #8494.
2013-08-16doc: convert remaining uses of core:: to std::.Huon Wilson-14/+14
2013-08-16doc: correct spelling in documentation.Huon Wilson-6/+5
2013-08-15Add ToCStr method .with_c_str()Kevin Ballard-8/+8
.with_c_str() is a replacement for the old .as_c_str(), to avoid unnecessary boilerplate. Replace all usages of .to_c_str().with_ref() with .with_c_str().
2013-08-13auto merge of #8475 : kmcallister/rust/stack_segment, r=brson,brsonbors-2/+2
Servo needs to tell SpiderMonkey about the stack bounds. r? @brson
2013-08-13Make rt::stack publicKeegan McAllister-1/+1
Fixes #8478.
2013-08-13auto merge of #8423 : alexcrichton/rust/less-priv-again, r=bstriebors-8/+8
Closes #5495
2013-08-13auto merge of #8411 : bblum/rust/assorted-fixes, r=brsonbors-322/+32
Each commit is pretty much what it says on the tin. r anybody.
2013-08-12Forbid pub/priv where it has no effectAlex Crichton-8/+8
Closes #5495
2013-08-12std: Re-optimize tls access on local allocation pathBrian Anderson-9/+17
I did this once but acciddentally undid it in a later patch.
2013-08-12rt::task: Make current_stack_segment publicKeegan McAllister-1/+1
Servo needs to tell SpiderMonkey about the stack bounds.
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