DEVFYI - Developer Resource - FYI

What is Mutex Object and why it is used?

Windows programming Interview Questions and Answers


(Continued from previous question...)

28. What is Mutex Object and why it is used?

A mutex object is a synchronization object whose state is set to signaled when it is not owned by any thread, and non-signaled when it is owned. For example, to prevent two threads from writing to shared memory at the same time, each thread waits for ownership of a mutex object before executing the code that accesses the memory. After writing to the shared memory, the thread releases the mutex object.

(Continued on next question...)

Other Interview Questions