Skip to content

Limiting Queue Depth for Blocking Thread Pool #6347

Answered by Darksonn
joshleeb asked this question in Q&A
Discussion options

You must be logged in to vote

No, the queue is unbounded. If you need custom limits on spawn_blocking tasks, then you can use a Semaphore. See its examples for ideas. You should be able to use try_acquire to fail spawning when there are too many tasks.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@joshleeb
Comment options

Answer selected by joshleeb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants