|
| Total Answers and Comments: 3 |
Last Update: February 19, 2006 Asked by: Beena |
|
| | |
|
Submitted by: smokie brown Mutex is a mechanism which is useful in coordinating mutually exclusive access to a shared resource. 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.Threads that are waiting for ownership of a mutex are placed in a first in, first out (FIFO) queue. Therefore, the first thread to wait on the mutex will be the first to receive ownership of the mutex, regardless of thread priority. However, kernel-mode APCs and events that suspend a thread will cause the system to remove the thread from the queue. When the thread resumes its wait for the mutex, it is placed at the end of the queue.
Above answer was rated as good by the following members: amit.bansal07 | Go To Top
|