Hello Rust community,
Since both libraries use different thread pools (I assume) under the hood and the consumer of my crate could use either
crossbeam (or any other thread-pool-library really) in their application, how can I make my crate "thread-pool-library agnostic", meaning using the same thread pool that my consumer uses/wants to use?
The only solution that comes to my mind is using cargo features, where one feature is e.g.
rayon and another is
crossbeam and depending on the chosen feature I use
crossbeam internally in my crate.
What is the best approach here in your opinion? If I end up using the
cargo feature approach, is there any popular threading library with their own thread pool I've forgotten?
I really appreciate your help.