Semaphores and mutexes let processes share data safely: only one of them may be inside the critical section at a time, so results never depend on timing.