diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-12-30 00:55:27 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-01-01 13:08:09 -0800 |
| commit | 3f11f8738201dcf230a1647e30c312c980513b37 (patch) | |
| tree | 9a26968f6aba2cba79017730255000ef52d8b74a /src/rustllvm/RustWrapper.cpp | |
| parent | 0cbb44aff9a9840c133ea454db7d302c247d5f0f (diff) | |
| download | rust-3f11f8738201dcf230a1647e30c312c980513b37.tar.gz rust-3f11f8738201dcf230a1647e30c312c980513b37.zip | |
Move task count bookeeping out of libstd
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).
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
