Skip to content

Small issue with lates release #44

@Green-Sky

Description

@Green-Sky

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 that std::atomic is non-copyable and non-movable, while std::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: declaring bool flag; a volatile.

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions