This question evaluates understanding of concurrent programming and synchronization primitives by requiring ordered execution across multiple threads without busy-waiting.
Implement a class with three methods alpha(), beta(), and gamma() that may be called by three different threads in arbitrary order, but must print their outputs in the fixed order A, B, C for N cycles. Use synchronization primitives to ensure ordering without busy-waiting, discuss fairness and potential deadlocks, and analyze the performance implications.