Question 19
Back to Exercise
What is the difference between C++20 std::latch and std::barrier?
- A None
- B A latch counts down once and cannot be reused; a barrier resets after each phase so threads can meet repeatedly Correct
- C A barrier counts up
- D A latch is a mutex
Correct Answer: Option B
A barrier can also run a completion function at the end of each phase.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!