what is mutex?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If i have a dataset queried from Sql and I would like to insert the dataset into a specific node in an xml document how do I do this

1901


5. Which of the following can you do with DB2 Express- C? Query databases with SQL Query databases with XML using XQuery and XPath Use SQL in Xquery and Xquery in SQL All of the above

2368


WHAT IS THE MEANING OF CONSTANT ...EXEEDS LENGTH LIMIT WHILE COPYING FROM PS FILE TO KSDS

1808


what are the advantages of sap on other software ?

1929


will it allow to add same value in HashMap class.

1910


a characteristic of a multiprogramming is? a.simultaneous exe of pgm instr 4m 2 appli b.concurrent processing of 2 r more prgms c.multiple cpu s d.all the abov

1930


What is WEB 3.0? What are the features their in WEB3.0

1832


what is throws keyword

3354


code for connection from windows forms to sql server

1946


Which design patterns have you used?

1754


what are resources in case of Threads

1934


i want to improve my english vocab for racking campus written exam plz tell me best book for prepration......

1927


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 ?

3442


can any method return type may be constructor , or that method name allow

1820


sample and simple coding where we get?

2024