Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] the ThreadPool struct in rayon-core needs documentation #235

Closed
nikomatsakis opened this issue Mar 3, 2017 · 4 comments
Closed
Milestone

Comments

@nikomatsakis
Copy link
Member

nikomatsakis commented Mar 3, 2017

The ThreadPool struct represents a user created thread-pool (as opposed to the default, global threadpool). It needs /// foo docs.

Some things to say:

  • Create a new thread-pool with ThreadPool::new (!). You can use the configuration to specify the number or names of its threads, how to handle uncaptured panics, and so forth.
  • There are two ways to use the thread-pool:
    • The first is that you can execute ThreadPool::install(). This will execute a closure in one of the threadpool's threads. Any other Rayon operations -- like parallel iterators, join(), or scope() -- will then execute in the context of this thread-pool.
    • The second is that you invoke ThreadPool::spawn_async() or ThreadPool::spawn_future_async(). These methods will inject jobs into the thread-pool that are not tied to your current stack frame; however, those jobs cannot access data owned by the stack.
  • When the thread-pool is dropped, that is a signal for its threads to terminate. Once they have completed executing any remaining work that you have spawned, they will automatically terminate.
@nikomatsakis nikomatsakis added this to the 1.0 milestone Mar 3, 2017
@dmfutcher
Copy link

Can this be closed given #325 was merged?

@cuviper
Copy link
Member

cuviper commented Oct 21, 2017

Sounds good, thanks!

@cuviper cuviper closed this as completed Oct 21, 2017
@munael
Copy link

munael commented Oct 22, 2017

Are there any non-doc [help wanted] issues remaining or coming?

@cuviper
Copy link
Member

cuviper commented Oct 24, 2017

@Enamex I would say docs are where we're most lacking, but I'll try to remember to file any other ideas as I have them. I just filed #465, and maybe you could check if someone is still working on #330.

There are also open questions, like how to create parallel iterators from arbitrary iterators (#46) or vice versa (#210). I guess those could be considered [help wanted] in the sense of "help, we don't even know how to do this!" We tend to only tag [help wanted] on mentor-able issues, but anyone is welcome to chime in on other issues too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants