about summary refs log tree commit diff
path: root/src/libstd/rt/util.rs
AgeCommit message (Collapse)AuthorLines
2013-11-26Removed unneccessary `_iter` suffixes from various APIsMarvin Löbel-1/+1
2013-11-24Fix spelling of "vacuum" in one of the abort quotes.Jason Orendorff-1/+1
2013-11-13Implement native::IoFactoryAlex Crichton-19/+5
This commit re-organizes the io::native module slightly in order to have a working implementation of rtio::IoFactory which uses native implementations. The goal is to seamlessly multiplex among libuv/native implementations wherever necessary. Right now most of the native I/O is unimplemented, but we have existing bindings for file descriptors and processes which have been hooked up. What this means is that you can now invoke println!() from libstd with no local task, no local scheduler, and even without libuv. There's still plenty of work to do on the native I/O factory, but this is the first steps into making it an official portion of the standard library. I don't expect anyone to reach into io::native directly, but rather only std::io primitives will be used. Each std::io interface seamlessly falls back onto the native I/O implementation if the local scheduler doesn't have a libuv one (hurray trait ojects!)
2013-11-11Move std::rt::io to std::ioAlex Crichton-2/+2
2013-11-11Remove #[fixed_stack_segment] and #[rust_stack]Alex Crichton-3/+0
These two attributes are no longer useful now that Rust has decided to leave segmented stacks behind. It is assumed that the rust task's stack is always large enough to make an FFI call (due to the stack being very large). There's always the case of stack overflow, however, to consider. This does not change the behavior of stack overflow in Rust. This is still normally triggered by the __morestack function and aborts the whole process. C stack overflow will continue to corrupt the stack, however (as it did before this commit as well). The future improvement of a guard page at the end of every rust stack is still unimplemented and is intended to be the mechanism through which we attempt to detect C stack overflow. Closes #8822 Closes #10155
2013-10-24Test fixes and merge conflictsAlex Crichton-7/+13
2013-10-24Stop logging task failure to task loggersAlex Crichton-1/+1
The isn't an ideal patch, and the comment why is in the code. Basically uvio uses task::unkillable which touches the kill flag for a task, and if the task is failing due to mismangement of the kill flag, then there will be serious problems when the task tries to print that it's failing.
2013-10-24Move as much I/O as possible off of native::ioAlex Crichton-2/+11
When uv's TTY I/O is used for the stdio streams, the file descriptors are put into a non-blocking mode. This means that other concurrent writes to the same stream can fail with EAGAIN or EWOULDBLOCK. By all I/O to event-loop I/O, we avoid this error. There is one location which cannot move, which is the runtime's dumb_println function. This was implemented to handle the EAGAIN and EWOULDBLOCK errors and simply retry again and again.
2013-10-11De-pub some private runtime componentsAlex Crichton-16/+10
This change was waiting for privacy to get sorted out, which should be true now that #8215 has landed. Closes #4427
2013-10-10Migrate users of io::fd_t to io::native::file::fd_tAlex Crichton-4/+6
2013-09-30std: Remove usage of fmt!Alex Crichton-5/+5
2013-08-29rt: Handle non-integer RUST_THREADS (slightly) more gracefully.Huon Wilson-2/+8
Previously it would call Option.unwrap(), which calls `fail!` on None, which doesn't work without the runtime (e.g. when initialising it).
2013-08-24std::rt: Enforce sanity a while longerBrian Anderson-1/+2
I'm not comfortable turning off rtassert! yet
2013-08-23Define cfg(rtopt) when optimizing. Turn off runtime sanity checksBrian Anderson-0/+3
Naturally, and sadly, turning off sanity checks in the runtime is a noticable performance win. The particular test I'm running goes from ~1.5 s to ~1.3s. Sanity checks are turned *on* when not optimizing, or when cfg includes `rtdebug` or `rtassert`.
2013-08-23rt: Remove exit_status helpersBrian Anderson-16/+5
2013-08-20auto merge of #8566 : toddaaro/rust/idle-opt+cleaning, r=catamorphism,brsonbors-2/+1
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-19Try to fix mac valgrind bot by disabling thread-heavy activities.Graydon Hoare-1/+27
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-3/+10
2013-08-16A round of code cleaning for the primary scheduler code. Comments have been ↵toddaaro-2/+1
updated, a minor amount of support type restructing has happened, methods have been reordered, and some duplicate code has been purged.
2013-08-10std: merge Iterator and IteratorUtilErick Tryzelaar-1/+0
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-2/+2
- 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-07-09std: Make os::set_exit_status work with newschedBrian Anderson-0/+22
2013-06-24extra: Make test runner compatible with newschedBrian Anderson-0/+12
2013-06-18std::rt: Improve the rtabort! macroBrian Anderson-2/+63
2013-06-17std::rt: move abort function to util moduleBrian Anderson-0/+4
2013-06-17std::rt: Add util mod and num_cpus functionBrian Anderson-0/+22