Synchronize two threads to alternate printing A and B
Filed under Nvidia
The question
Modify two infinite-loop thread functions such that thread A prints 'A' and thread B prints 'B' alternately (using semaphores or synchronization primitives).
No write-up yet. Related questions below have one.
Related Nvidia questions
Collected from public candidate posts and coding forums. Updated Nov 2026.