All challenges
Multiple ChoiceIntermediate 45s

std::call_once Guarantees

What does std::call_once guarantee when multiple threads invoke it with the same once_flag?
Options
  1. 1The function runs at most once, and all callers synchronize with the completed call
  2. 2The function runs once per calling thread, so each caller gets its own invocation
  3. 3The function may run twice concurrently and the two results are merged afterwards
  4. 4It deadlocks whenever two or more threads call it with the same flag concurrently

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