summary refs log tree commit diff
path: root/src/libstd/rt/local.rs
AgeCommit message (Collapse)AuthorLines
2014-03-01Publicise types/add #[allow(visible_private_types)] to a variety of places.Huon Wilson-1/+1
There's a lot of these types in the compiler libraries, and a few of the older or private stdlib ones. Some types are obviously meant to be public, others not so much.
2014-01-29Removing do keyword from libstd and librustcScott Lawrence-11/+10
2014-01-05Fix some warningsCorey Richardson-1/+0
2014-01-01Move task count bookeeping out of libstdAlex Crichton-5/+18
For libgreen, bookeeping should not be global but rather on a per-pool basis. Inside libnative, it's known that there must be a global counter with a mutex/cvar. The benefit of taking this strategy is to remove this functionality from libstd to allow fine-grained control of it through libnative/libgreen. Notably, helper threads in libnative can manually decrement the global count so they don't count towards the global count of threads. Also, the shutdown process of *all* sched pools is now dependent on the number of tasks in the pool being 0 rather than this only being a hardcoded solution for the initial sched pool in libgreen. This involved adding a Local::try_take() method on the Local trait in order for the channel wakeup to work inside of libgreen. The channel send was happening from a SchedTask when there is no Task available in TLS, and now this is possible to work (remote wakeups are always possible, just a little slower).
2013-12-24std: Get stdtest all passing againAlex Crichton-10/+9
This commit brings the library up-to-date in order to get all tests passing again
2013-12-24green: Rip the bandaid off, introduce libgreenAlex Crichton-78/+1
This extracts everything related to green scheduling from libstd and introduces a new libgreen crate. This mostly involves deleting most of std::rt and moving it to libgreen. Along with the movement of code, this commit rearchitects many functions in the scheduler in order to adapt to the fact that Local::take now *only* works on a Task, not a scheduler. This mostly just involved threading the current green task through in a few locations, but there were one or two spots where things got hairy. There are a few repercussions of this commit: * tube/rc have been removed (the runtime implementation of rc) * There is no longer a "single threaded" spawning mode for tasks. This is now encompassed by 1:1 scheduling + communication. Convenience methods have been introduced that are specific to libgreen to assist in the spawning of pools of schedulers.
2013-12-10librustuv: RAII-ify `Local::borrow`, and remove some 12 Cells.Patrick Walton-43/+45
2013-11-27Use the native tls implementation on androidAlex Crichton-4/+4
Turns out android doesn't support LLVM's thread_local attribute and accompanying implementation. Closes #10686
2013-11-26librustc: Make `||` lambdas not infer to `proc`sPatrick Walton-5/+5
2013-11-26test: Remove non-procedure uses of `do` from compiletest, libstd tests,Patrick Walton-2/+2
compile-fail tests, run-fail tests, and run-pass tests.
2013-11-26libstd: Remove all non-`proc` uses of `do` from libstdPatrick Walton-8/+8
2013-11-19libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstdPatrick Walton-3/+3
2013-10-24Remove IoFactoryObject for ~IoFactoryAlex Crichton-20/+0
This involved changing a fair amount of code, rooted in how we access the local IoFactory instance. I added a helper method to the rtio module to access the optional local IoFactory. This is different than before in which it was assumed that a local IoFactory was *always* present. Now, a separate io_error is raised when an IoFactory is not present, yet I/O is requested.
2013-08-27librustc: Fix merge falloutPatrick Walton-1/+1
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-12/+16
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
2013-08-24std::rt: Optimize TLS use in change_task_contextBrian Anderson-0/+5
2013-08-24std: More TLS micro-optimizationBrian Anderson-9/+20
2013-08-12std: Re-optimize tls access on local allocation pathBrian Anderson-5/+1
I did this once but acciddentally undid it in a later patch.
2013-08-07std: Allow spawners to specify stack sizeBrian Anderson-5/+6
2013-08-04std::rt: Run the tests for Local in a bare threadBrian Anderson-36/+45
Otherwise interferes with the existing runtime
2013-08-01modified local to include an implementation for try_unsafe_borrow::<Task> so ↵toddaaro-2/+8
that the log methods will work
2013-08-01minor tweaks - unboxed the coroutine so that it is no longer a ~ pointer ↵toddaaro-2/+0
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-1/+1
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-59/+87
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-07-09std::rt: Do local tests in a bare thread to not interfere with the schedulerBrian Anderson-21/+30
2013-07-01Refactored the runtime to view coroutines as a component of tasks, instead ↵toddaaro-2/+7
of tasks as a component of coroutines.
2013-06-17std: Rename `abort!` to `rtabort!` to match other macrosBrian Anderson-12/+12
2013-06-14redesigned the pinning to pin deal with things on dequeue, not on enqueuetoddaaro-3/+3
2013-06-10debugged a compiler ICE when merging local::borrow changes into the main io ↵toddaaro-5/+30
branch and modified the incoming new file lang.rs to be api-compatible
2013-05-30core::rt: deny(unused_imports, unused_mut, unused_variable)Brian Anderson-1/+0
2013-05-29Merge remote-tracking branch 'brson/io' into incomingBrian Anderson-4/+5
Conflicts: src/libstd/rt/sched.rs
2013-05-23cleanup warnings from libstdErick Tryzelaar-4/+4
2013-05-22libstd: Fix merge fallout.Patrick Walton-0/+118