about summary refs log tree commit diff
path: root/src/libstd/rt
AgeCommit message (Collapse)AuthorLines
2013-12-04Revert "libstd: Change `Path::new` to `Path::init`."Kevin Ballard-1/+1
This reverts commit c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b. Leave the #[ignores] in that were added to rustpkg tests. Conflicts: src/librustc/driver/driver.rs src/librustc/metadata/creader.rs
2013-12-03Move std::util::ignore to std::prelude::dropSteven Fackler-2/+1
It's a more fitting name for the most common use case of this function.
2013-12-03auto merge of #10747 : alexcrichton/rust/snapshots, r=cmrbors-5/+0
This registers new snapshots after the landing of #10528, and then goes on to tweak the build process to build a monolithic `rustc` binary for use in future snapshots. This mainly involved dropping the dynamic dependency on `librustllvm`, so that's now built as a static library (with a dynamically generated rust file listing LLVM dependencies). This currently doesn't actually make the snapshot any smaller (24MB => 23MB), but I noticed that the executable has 11MB of metadata so once progress is made on #10740 we should have a much smaller snapshot. There's not really a super-compelling reason to distribute just a binary because we have all the infrastructure for dealing with a directory structure, but to me it seems "more correct" that a snapshot compiler is just a `rustc` binary.
2013-12-03Register new snapshotsAlex Crichton-5/+0
2013-11-30auto merge of #10733 : alexcrichton/rust/ignore-on-windows, r=pcwaltonbors-0/+1
I've seen this fail on windows twice now, and it's not clear to me why it's failing. For now, ignore it on that platform while investigation enuses.
2013-11-29Ignore a deque test on windowsAlex Crichton-0/+1
I've seen this fail on windows twice now, and it's not clear to me why it's failing. For now, ignore it on that platform while investigation enuses.
2013-11-29auto merge of #10719 : Kimundi/rust/switch_to_multi_item_macros, r=alexcrichtonbors-2/+1
- Removed module reexport workaround for the integer module macros - Removed legacy reexports of `cmp::{min, max}` in the integer module macros - Combined a few macros in `vec` into one - Documented a few issues
2013-11-29Implement a lock-free work-stealing dequeAlex Crichton-132/+714
This adds an implementation of the Chase-Lev work-stealing deque to libstd under std::rt::deque. I've been unable to break the implementation of the deque itself, and it's not super highly optimized just yet (everything uses a SeqCst memory ordering). The major snag in implementing the chase-lev deque is that the buffers used to store data internally cannot get deallocated back to the OS. In the meantime, a shared buffer pool (synchronized by a normal mutex) is used to deallocate/allocate buffers from. This is done in hope of not overcommitting too much memory. It is in theory possible to eventually free the buffers, but one must be very careful in doing so. I was unable to get some good numbers from src/test/bench tests (I don't think many of them are slamming the work queue that much), but I was able to get some good numbers from one of my own tests. In a recent rewrite of select::select(), I found that my implementation was incredibly slow due to contention on the shared work queue. Upon switching to the parallel deque, I saw the contention drop to 0 and the runtime go from 1.6s to 0.9s with the most amount of time spent in libuv awakening the schedulers (plus allocations). Closes #4877
2013-11-29Removed useless cmp::{min, max} reexports from the integer modulesMarvin Löbel-2/+1
2013-11-29libstd: Change `Path::new` to `Path::init`.Patrick Walton-1/+1
2013-11-28Register new snapshotsAlex Crichton-10/+9
2013-11-27Use the native tls implementation on androidAlex Crichton-248/+227
Turns out android doesn't support LLVM's thread_local attribute and accompanying implementation. Closes #10686
2013-11-27Improve the rt::thread moduleAlex Crichton-61/+153
* Added doc comments explaining what all public functionality does. * Added the ability to spawn a detached thread * Added the ability for the procs to return a value in 'join'
2013-11-26Clean up statically initialized data on shutdownAlex Crichton-14/+55
Whenever the runtime is shut down, add a few hooks to clean up some of the statically initialized data of the runtime. Note that this is an unsafe operation because there's no guarantee on behalf of the runtime that there's no other code running which is using the runtime. This helps turn down the noise a bit in the valgrind output related to statically initialized mutexes. It doesn't turn the noise down to 0 because there are still statically initialized mutexes in dynamic_lib and os::with_env_lock, but I believe that it would be easy enough to add exceptions for those cases and I don't think that it's the runtime's job to go and clean up that data.
2013-11-26auto merge of #10312 : thestinger/rust/thread_local, r=alexcritchtonbors-5/+105
This provides a building block for fast thread-local storage. It does not change the safety semantics of `static mut`. Closes #10310
2013-11-26port the runtime to `#[thread_local]`Daniel Micay-5/+105
2013-11-26librustc: Fix merge fallout.Patrick Walton-5/+5
2013-11-26libstd: Fix Win32 and other bustage.Patrick Walton-5/+5
2013-11-26librustc: Make `||` lambdas not infer to `proc`sPatrick Walton-26/+34
2013-11-26test: Remove non-procedure uses of `do` from compiletest, libstd tests,Patrick Walton-40/+40
compile-fail tests, run-fail tests, and run-pass tests.
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