#720·crossbeam

no way to set max capacity size of deque

Author: mooreniemiCreated Jul 14, 2021Updated Feb 21, 2026
Labelsquestioncrossbeam-deque

Confirming my understanding of the code: there is no way to enforce a max capacity size on the "buffer that holds tasks in a worker queue" which means it would grow unbounded to max usize with unbounded tasks added, right? Should I then make sure to throttle tasks upstream of using this deque?

https://github.com/crossbeam-rs/crossbeam/blob/311124c8336c80dfdce1b8f4b29f2a27f035725c/crossbeam-deque/src/deque.rs#L31

https://github.com/crossbeam-rs/crossbeam/blob/311124c8336c80dfdce1b8f4b29f2a27f035725c/crossbeam-deque/src/deque.rs#L281

I was curious about this because Rayon uses this data structure for its worker threadpool.