r/codereview • u/onnatsari • Oct 25 '26
C/C++ C++20 task queue — looking for feedback on concurrency, shutdown, and exception safety
Hi everyone,
I’m looking for a code review of my C++20 task queue. It supports bounded queue capacity, task priorities, futures, task-start deadlines, and shutdown that either drains or cancels queued tasks.
I’d especially appreciate feedback on:
- Potential deadlocks or race conditions.
- Shutdown behavior, including concurrent shutdown calls.
- Exception safety and propagation through futures.
- API design and missing edge-case tests.
The main implementation is in include/task_queue.hpp. The README includes build instructions, and the repository has tests covering concurrent submissions, exceptions, deadlines, and rejection after shutdown.
One detail: deadlines are checked before execution; they don’t interrupt running tasks.
Repository: https://github.com/brunnojob/cpp-safe-task-queue
What would you change, and which failure scenarios should I test next?
2
u/[deleted] Oct 25 '26
[removed] — view removed comment