diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-12-13 16:26:02 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-12-24 19:59:53 -0800 |
| commit | 3893716390f2c4857b7e8b1705a6344f96b85bb6 (patch) | |
| tree | 1a01099d27673c9906267ce82c024b33c61c1f13 /src/rustllvm/RustWrapper.cpp | |
| parent | afd4e2ad8dc4112b99c8d30996ff0bb5b0516b53 (diff) | |
| download | rust-3893716390f2c4857b7e8b1705a6344f96b85bb6.tar.gz rust-3893716390f2c4857b7e8b1705a6344f96b85bb6.zip | |
Finalize the green::Pool type
The scheduler pool now has a much more simplified interface. There is now a clear distinction between creating the pool and then interacting the pool. When a pool is created, all schedulers are not active, and only later if a spawn is done does activity occur. There are four operations that you can do on a pool: 1. Create a new pool. The only argument to this function is the configuration for the scheduler pool. Currently the only configuration parameter is the number of threads to initially spawn. 2. Spawn a task into this pool. This takes a procedure and task configuration options and spawns a new task into the pool of schedulers. 3. Spawn a new scheduler into the pool. This will return a handle on which to communicate with the scheduler in order to do something like a pinned task. 4. Shut down the scheduler pool. This will consume the scheduler pool, request all of the schedulers to shut down, and then wait on all the scheduler threads. Currently this will block the invoking OS thread, but I plan on making 'Thread::join' not a thread-blocking call. These operations can be used to encode all current usage of M:N schedulers, as well as providing a simple interface through which a pool can be modified. There is currently no way to remove a scheduler from a pool of scheduler, as there's no way to guarantee that a scheduler has exited. This may be added in the future, however (as necessary).
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
