3 ms·
For thread pools I'm pretty sure you can use Rayon. I agree with 99% of this but I can't agree with Crossbeam. I use it basically every time I need multiple th
by IshKebab 6y ago
For thread pools I'm pretty sure you can use Rayon.
I agree with 99% of this but I can't agree with Crossbeam. I use it basically every time I need multiple threads because you always end up needing `select!()`. As far as I know std doesn't have anything like that which makes its channels rather useless.
- wngr 6y agoWhile I agree with your sentiment, and do the same, `select!` is not more than looping through a couple of `try_recv` calls. So in the spirit of the author, a few lines of boilerplate vs a new dependency.
- Matthias247 6y ago> `select!` is not more than looping through a couple of `try_recv` calls. That's wrong. Any `try_recv` call will not make the thread park until one of the expected action happened. You can implement a busy loop which calls `try_recv()` - but this is by far not as efficient as what `select` does.