GithubHelp home page GithubHelp logo

Comments (6)

 avatar commented on May 10, 2024 7

The library ecosystem has evolved quite a bit since this question was asked. Tokio is now the thread pool for async IO and Rayon is the thread pool for parallel CPU-intensive tasks.

Since we already have two universal thread pools that cover a wide range of use cases, I don't see a need for creating another one. Even if neither Tokio nor Rayon are good enough for a particular use case, then a simple thread pool provided by Crossbeam probably won't be either.

Should we close this issue?

from crossbeam.

teburd avatar teburd commented on May 10, 2024

+1

from crossbeam.

upsuper avatar upsuper commented on May 10, 2024

It would probably also be useful to allow user to control which task goes to which thread, for example, something like

let pool = Pool::new(8);
pool.scoped(|threads| {
    for (thread, task) in threads.iter().zip(tasks.iter()) {
        thread.dispatch(task);
    }
});

from crossbeam.

upsuper avatar upsuper commented on May 10, 2024

One use case of thread pool can be seen in bryant/argon2rs, where fixed number of threads need to be synchronized frequently, which isn't quite doable with crossbeam right now.

from crossbeam.

jeehoonkang avatar jeehoonkang commented on May 10, 2024

FYI, probably this is one of the most relevant crates to this issue: https://github.com/Kimundi/scoped-threadpool-rs . Also there is a discussion on various Rust libraries on cpu pools: rust-lang/futures-rs#411

from crossbeam.

jeehoonkang avatar jeehoonkang commented on May 10, 2024

Also related: https://docs.rs/rayon/0.9.0/rayon/fn.scope.html . At least, we need to write a better documentation as done in Rayon.

from crossbeam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.