what is mutex?

Answers were Sorted based on User's Feedback



what is mutex?..

Answer / rock star

Mutual exclusion (often abbreviated to mutex) algorithms are
used in concurrent programming to avoid the simultaneous use
of a common resource, such as a global variable, by pieces
of computer code called critical sections.

Examples of such resources are fine-grained flags, counters
or queues, used to communicate between code that runs
concurrently, such as an application and its interrupt
handlers. The problem is acute because a thread can be
stopped or started at any time.

To illustrate: suppose a section of code is mutating a piece
of data over several program steps, when another thread,
perhaps triggered by some unpredictable event, starts
executing. If this second thread reads from the same piece
of data, the data, in the process of being overwritten, is
in an inconsistent and unpredictable state. If the second
thread tries overwriting that data, the ensuing state will
probably be unrecoverable. These critical sections of code
accessing shared data must therefore be protected, so that
other processes which read from or write to the chunk of
data are excluded from running.

A mutex is also a common name for a program object that
negotiates mutual exclusion among threads, also called a lock.

Is This Answer Correct ?    8 Yes 3 No

what is mutex?..

Answer / nadeem khokhar

A mutex and the binary semaphore are essentially the same. Both can take values: 0 or 1. However, there is a significant difference between them that makes mutexes more efficient than binary semaphores.

A mutex can be unlocked only by the thread that locked it.

Is This Answer Correct ?    2 Yes 0 No

what is mutex?..

Answer / sunildummati

Short for mutual exclusion object. In computer
programming, a mutex is a program object that allows
multiple program threads to share the same resource, such
as file access, but not simultaneously. When a program is
started, a mutex is created with a unique name. After this
stage, any thread that needs the resource must lock the
mutex from other threads while it is using the resource.
The mutex is set to unlock when the data is no longer
needed or the routine is finished.

(2) When spelled MuTeX, a package of macros for the TeX
typesetting system that supports musical notation. MuTeX
was written by Andrea Steinbach and Angelika Schofer, as a
master's thesis at Rheinische Friedrich-Wilhelms
University.

Is This Answer Correct ?    0 Yes 0 No

what is mutex?..

Answer / rajesh verma

A Mutex is a mutually exclusive flag. It acts as a gate keeper to a section of code allowing one thread in and blocking access to all others. This ensures that the code being controled will only be hit by a single read at a time. Just be sure to release the mutex when you are

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Programming Languages AllOther Interview Questions

kindly send interview materials

0 Answers   SoftSquare,


Bonjour, svp je veut voir comment envoyer un mail en java et comment changer le droit d'accé d'un fichier en java: de lecture en lecture/écriture et merci d'avance ;)

0 Answers  


how will you code the subfile which is in editing mode (multiple case subfile)?

0 Answers   Bank Of America,


I want to pass .pdf files as OlE Object to crystal report through VB6. Please any one guid me...

0 Answers  


how CLR identify vb file?

0 Answers   Tech Mahindra,






1. Write a program to create a sentence at runtime and count number of vowels in it ? 2. Write a program to get a string and to convert the 1st letter of it to uppercase ?

0 Answers   HTC,


which of the following is efficient in terms of space a. insertion sort b. quick sort c. selection d. both a and c

1 Answers   Hughes,


what is the difference between a looping statement and a decision statement

3 Answers  


what is software

2 Answers  


how will you do destructive read and non destructive read in data queue.....

0 Answers   CTS,


1Q) your current CTC (current taking currency)? 2Q) Your take home salary?(Monthly Drawing amount, According to your payslips/bank statement) 3Q) Your Expected CTC? 4Q) Your home take salary?

1 Answers  


How can successful and thorough systems planning, analysis, and design be ruined by poor systems construction and implementation? How can poor systems analysis or design ruin a smooth construction and implementation? For both questions, list some consequences

1 Answers  


Categories