What is MUTEX?

Questions by Beena   answers by Beena

Showing Answers 1 - 3 of 3 Answers

suraj

  • Oct 17th, 2005
 

1. Mutexes can synchronize threads within the same  process  or
     in other processes.

2. Mutexes  can  be  used  to  synchronize  threads
    between  processes  if the mutexes are allocated in writable
    memory and  shared  among  the  cooperating  processes   and    have been initialized for this task.

  Was this answer useful?  Yes

smokie brown

  • Feb 19th, 2006
 

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.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions