Synchronize n threads (n/2 producers, n/2 consumers) such that producer i produces an item for consumer i, and the execution order strictly alternates: P1, C1, P2, C2, ..., Pn/2, Cn/2.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.