-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tbb::task_arena::enqueue
should at least document that execution order isn't guaranteed
#1313
Comments
Hi @BenFrantzDale, there is no mention of FIFO guarantee into enqueue specification. |
@pavelkumbrasev Thanks. From those docs I'm still not clear what I know there's no mention of a FIFO guarantee in I'd be happy to PR documentation changes to clarify, but I'm not sure what the rules actually are. And in general, if you know a way to set |
Hi @BenFrantzDale, You can submit PR into oneTBB specification. There is a link to a PR as an example. |
@BenFrantzDale Is this is still relevant? |
It's been a while since I thought about this one, and I'm not finding the HTML docs for //! Enqueues a task into the arena to process a functor, and immediately returns.
//! Does not require the calling thread to join the arena
+ //! Note: Order of execution is not guaranteed, even if the arena is constructed
+ //! with max_concurrency == 1. I opened this ticket because I found it surprising, and I wound up having to do something round-about to get the behavior I wanted: fire-and-forget in-order execution of items on a queue, one at a time. |
I was surprised to find that enqueueing into a
tbb::task_arena{1}
doesn't execute in FIFO order: https://godbolt.org/z/qz1hq3zaE (Although I realize now that fortbb::task_arena{1}
I havearena.max_concurrency() == 2
, which is not what I'd expect...)At very least, the docs for
tbb::task_arena::enqueue
should be clear about this.At best, it should be that there's a way to make a
tbb::task_arena
that I can enqueue FIFO work into and have order guaranteed for the case ofmax_concurrency == 1
.The text was updated successfully, but these errors were encountered: