summary refs log tree commit diff
path: root/src/libstd/rt
AgeCommit message (Collapse)AuthorLines
2013-11-26libstd: Remove all non-`proc` uses of `do` from libstdPatrick Walton-154/+131
2013-11-26Removed unneccessary `_iter` suffixes from various APIsMarvin Löbel-4/+4
2013-11-25auto merge of #10631 : klutzy/rust/win-fixes, r=alexcrichtonbors-4/+9
This patchset fixes some parts broken on Win64. This also adds `--disable-pthreads` flags to llvm on mingw-w64 archs (both 32-bit and 64-bit, not mingw) due to bad performance. See #8996 for discussion.
2013-11-25auto merge of #10643 : jorendorff/rust/master, r=alexcrichtonbors-1/+1
2013-11-24auto merge of #10603 : alexcrichton/rust/no-linked-failure, r=brsonbors-752/+36
The reasons for doing this are: * The model on which linked failure is based is inherently complex * The implementation is also very complex, and there are few remaining who fully understand the implementation * There are existing race conditions in the core context switching function of the scheduler, and possibly others. * It's unclear whether this model of linked failure maps well to a 1:1 threading model Linked failure is often a desired aspect of tasks, but we would like to take a much more conservative approach in re-implementing linked failure if at all. Closes #8674 Closes #8318 Closes #8863
2013-11-24Remove linked failure from the runtimeAlex Crichton-752/+36
The reasons for doing this are: * The model on which linked failure is based is inherently complex * The implementation is also very complex, and there are few remaining who fully understand the implementation * There are existing race conditions in the core context switching function of the scheduler, and possibly others. * It's unclear whether this model of linked failure maps well to a 1:1 threading model Linked failure is often a desired aspect of tasks, but we would like to take a much more conservative approach in re-implementing linked failure if at all. Closes #8674 Closes #8318 Closes #8863
2013-11-24Fix spelling of "vacuum" in one of the abort quotes.Jason Orendorff-1/+1
2013-11-24std::rt: Fix crate_map on Win64klutzy-1/+6
2013-11-24std::rt: Fix record_stack_bounds on win64klutzy-2/+2
2013-11-24std: Fix transmute error on win64klutzy-1/+1
2013-11-23Move mutable::Mut to cell::RefCellSteven Fackler-8/+7
2013-11-22Change Mut::map to Mut::withSteven Fackler-3/+3
2013-11-22Cell -> Mut switch in commSteven Fackler-20/+24
2013-11-22The original fixme #2699 was removed back in PR #6053.Felix S. Klock II-1/+0
I cannot tell whether the original comment was unsure about the arithmetic calculations, or if it was unsure about the assumptions being made about the alignment of the current allocation pointer. The arithmetic calculation looks fine to me, though. This technique is documented e.g. in Henry Warren's "Hacker's Delight" (section 3-1). (I am sure one can find it elsewhere too, its not an obscure property.)
2013-11-19libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstdPatrick Walton-30/+30
2013-11-19auto merge of #10558 : alexcrichton/rust/faster-stdout, r=pcwalton,pcwaltonbors-0/+1
There are issues with reading stdin when it is actually attached to a pipe, but I have run into no problems in writing to stdout/stderr when they are attached to pipes.
2013-11-18auto merge of #10561 : pcwalton/rust/procify, r=alexcrichtonbors-46/+64
r? @alexcrichton
2013-11-18Move runtime files to C instead of C++Alex Crichton-0/+1
Explicitly have the only C++ portion of the runtime be one file with exception handling. All other runtime files must now live in C and be fully defined in C.
2013-11-18Remove the C++ lock_and_signal typeAlex Crichton-33/+52
A the same time this purges all runtime support needed for statically initialized mutexes, moving all users over to the new Mutex type instead.
2013-11-18libstd: Change all `~fn()`s to `proc`s in the standard library.Patrick Walton-46/+64
This makes `Cell`s no longer necessary in most cases.
2013-11-18Allow piped stdout/stderr use uv_tty_tAlex Crichton-0/+1
There are issues with reading stdin when it is actually attached to a pipe, but I have run into no problems in writing to stdout/stderr when they are attached to pipes.
2013-11-18rt: Namespace all C functions under rust_Brian Anderson-8/+8
2013-11-13Implement native::IoFactoryAlex Crichton-31/+29
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-8654/+24
2013-11-11auto merge of #10424 : alexcrichton/rust/optimize-buffered, r=brsonbors-2/+13
I was benchmarking rust-http recently, and I saw that 50% of its time was spent creating buffered readers/writers. Albeit rust-http wasn't using std::rt::io::buffered, but the same idea applies here. It's much cheaper to malloc a large region and not initialize it than to set it all to 0. Buffered readers/writers never use uninitialized data, and their internal buffers are encapsulated, so any usage of uninitialized slots are an implementation bug in the readers/writers.
2013-11-12Implemented a ProcessExit enum and helper methods to std::rt::io::process ↵Matthew Iselin-3/+39
for getting process termination status, or the signal that terminated a process. A test has been added to rtio-processes.rs to ensure signal termination is picked up correctly.
2013-11-11Decrease the default stack size back to 2MBAlex Crichton-1/+1
I increased this to 4MB when I implemented abort-on-stack-overflow for Rust functions. Now that the fixed_stack_segment attribute is removed, no rust function will ever reasonably request 2MB of stack (due to calling an FFI function). The default size of 2MB should be plenty for everyday use-cases, and tasks can still request more stack via the spawning API.
2013-11-11Remove #[fixed_stack_segment] and #[rust_stack]Alex Crichton-113/+8
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-11-11Optimize creation of buffered readers/writersAlex Crichton-2/+13
I was benchmarking rust-http recently, and I saw that 50% of its time was spent creating buffered readers/writers. Albeit rust-http wasn't using std::rt::io::buffered, but the same idea applies here. It's much cheaper to malloc a large region and not initialize it than to set it all to 0. Buffered readers/writers never use uninitialized data, and their internal buffers are encapsulated, so any usage of uninitialized slots are an implementation bug in the readers/writers.
2013-11-11auto merge of #10409 : alexcrichton/rust/issue-10386, r=brsonbors-1/+5
Turns out the pipe names must have special names on windows. Once we have special names, all the tests pass just fine. Closes #10386
2013-11-11auto merge of #10394 : yichoi/rust/make_check_pass_android, r=brsonbors-3/+4
To enable test on android bot #9120 some tests are disabled and can be fixed further.
2013-11-11Clean lint on test buildCorey Richardson-2/+0
2013-11-10Enable uv pipe tests on windowsAlex Crichton-1/+5
Turns out the pipe names must have special names on windows. Once we have special names, all the tests pass just fine. Closes #10386
2013-11-10Register new snapshotsAlex Crichton-23/+4
2013-11-10Fix usage of libuv for windowsAlex Crichton-7/+13
2013-11-10Another round of test fixes from previous commitsAlex Crichton-24/+23
2013-11-10Fall back from uv tty instances more aggressivelyAlex Crichton-5/+2
It appears that uv's support for interacting with a stdio stream as a tty when it's actually a pipe is pretty problematic. To get around this, promote a check to see if the stream is a tty to the top of the tty constructor, and bail out quickly if it's not identified as a tty. Closes #10237
2013-11-10Assorted test fixes and merge conflictsAlex Crichton-4/+5
2013-11-10Rework the idle callback to have a safer interfaceAlex Crichton-21/+11
It turns out that the uv implementation would cause use-after-free if the idle callback was used after the call to `close`, and additionally nothing would ever really work that well if `start()` were called twice. To change this, the `start` and `close` methods were removed in favor of specifying the callback at creation, and allowing destruction to take care of closing the watcher.
2013-11-10Add bindings to uv's utime functionAlex Crichton-4/+47
This exposes the ability to change the modification and access times on a file. Closes #10266
2013-11-10Clean up the remaining chunks of uvAlex Crichton-14/+14
2013-11-10Start migrating stream I/O away from ~fn()Alex Crichton-2/+0
2013-11-10Remove usage of ~fn from the schedulerAlex Crichton-3/+2
2013-11-10Remove usage of ~fn() from uv async/idleAlex Crichton-18/+31
2013-11-10temporarily disable tests on android and tagging issue number #10378Young-il Choi-3/+3
2013-11-10disable tests on android since tcp/ip permission cannot be acquired without ↵Young-il Choi-0/+1
help of apk
2013-11-05Move implementation for threads to RustDirkjan Bussink-30/+97
This binds to the appropriate pthreads_* and Windows specific functions and calls them from Rust. This allows for removal of the C++ support code for threads. Fixes #10162
2013-11-04auto merge of #10270 : alexcrichton/rust/no-super-buffer, r=brsonbors-13/+5
Right now if you're running a program with its output piped to some location and the program decides to go awry, when you kill the program via some signal none of the program's last 4K of output will get printed to the screen. In theory the solution to this would be to register a signal handler as part of the runtime which then flushes the output stream. I believe that the current behavior is far enough from what's expected that we shouldn't be providing this sort of "super buffering" by default when stdout isn't attached to a tty.
2013-11-04auto merge of #10182 : alexcrichton/rust/typeid-intrinsic, r=nikomatsakisbors-55/+26
This isn't quite as fancy as the struct in #9913, but I'm not sure we should be exposing crate names/hashes of the types. That being said, it'd be pretty easy to extend this (the deterministic hashing regardless of what crate you're in was the hard part).
2013-11-04Stop extra buffering when stdout isn't a ttyAlex Crichton-13/+5
Right now if you're running a program with its output piped to some location and the program decides to go awry, when you kill the program via some signal none of the program's last 4K of output will get printed to the screen. In theory the solution to this would be to register a signal handler as part of the runtime which then flushes the output stream. I believe that the current behavior is far enough from what's expected that we shouldn't be providing this sort of "super buffering" by default when stdout isn't attached to a tty.