-
Notifications
You must be signed in to change notification settings - Fork 287
Closed
Description
So I was extending the fresh thread-pool release with a priority_queue. While doing so I ran into multiple issues:
std::vector<std::atomic<bool>>
seems to be invalid code.
I read thatstd::atomic
is non-copyable and non-movable, whilestd::vector
requires at least either.- running static analysis (cppcheck) told me
flag1 == falg2
comparing the same value.
Not sure if cppcheck is right here, but I think a compiler might optimize this away...
Possible solution: declaringbool flag;
avolatile
.
I really like how simple the Library is 😃
My wip code: https://github.com/Green-Sky/thread-pool/commits/priority_queue
Right now my code consistently fails the "task monitoring" test. I suspect the first issue to be the cause.
Metadata
Metadata
Assignees
Labels
No labels