GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Operating System  >  Shell Scripting
Go To First  |  Previous Question  |  Next Question 
 Shell Scripting  |  Question 16 of 47    Print  
What is MUTEX?

  
Total Answers and Comments: 3 Last Update: February 19, 2006     Asked by: Beena 
  
 Sponsored Links

 
 Best Rated Answer
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
September 23, 2005 03:56:48   #1  
sridhar_madadi Member Since: September 2005   Contribution: 23    

RE: What is MUTEX?
Short for mutual exclusion object. A mutex is a program object that allows multiple program threads to share the same resource such as file access but not simultaneously
 
Is this answer useful? Yes | No
October 17, 2005 06:42:01   #2  
suraj        

RE: What is MUTEX?

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.


 
Is this answer useful? Yes | No
February 19, 2006 02:52:52   #3  
smokie brown        

RE: What is MUTEX?
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.
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape