Intel Corporation Interview Question

Difference between mutex and semaphore. how they are implemented.

Interview Answer

Anonymous

Oct 27, 2012

Mutex is a private case of Semaphore (initiated to 1) I think you mean the difference between Semaphore and Spin Lock Anyway a process which locked by Spin Lock wil spin the CPU whenever it will get the CPU where as in case of Semaphore the process will sleep until it will be signaled. implementation of Spin Lock can be by hardware which can test and set a given variable in one single atomic command.