Question d’entretien chez AMD

c++ threads usage, semaphore, how to write thread safe code