All challenges
Multiple ChoiceIntermediate 45s

latch vs barrier reusability

What is the key distinction between std::latch and std::barrier?
Options
  1. 1A latch is reusable across multiple phases while a barrier is single-use and cannot be reset
  2. 2A barrier is reusable across phases with a completion callback; a latch is single-use
  3. 3They are identical aliases with interchangeable names and exactly the same semantics
  4. 4A latch only works with exactly two threads while a barrier scales to arbitrary counts

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle