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

Code for display the images from drive using vb 6.0?

4291


how to data grid use in data bind?

1494


in network security,how we identified threat?some one say we found threat according to it's signature,but how we get signature or pattern of the virus?

1522


Mainly Related to Oracle, DBMS , Oracle Stored Procedures, Functions, Oracle 9i Architecture, Redo logs..., Views,

1865


HOW TO FIND NUMBER OF TWOS IN N!(N FACTORIAL)??

1789






Wrtite a JCL for sorting a file with start from 36 postion lenth 9 excluding a num eq to 98768. for 3 marks mainframe

1469


How do you pass variables forwrd to future CECI sessions

4081


How to merge Action Form with Dyna Action Form in Struts.

1896


what is client server & server? What r types of Joins? explsin it! which types of indexex in sql server? what is triggers?

1521


Have you used callsymputx? what points need to be kept in mind when using it?

1541


I need to fetch all rows from the table based one field value in the table and later do a condition check if the condition is true I will have to move all the rows present in the data base to output file one else if the condition is not satisfied then move all the records of that field value into another file .Please let me know how to do that

1658


What is SOLID Principle in Programming Language?

660


i am exeprienced person what is selection process

1132


qtp 9.2 14 days demo version was expired.I uninstalled how to reinstall this again

2356


Hi Guys, This is Rama, right now I am working as a Software Test Engineer in Gurgoan and I have over all 3 years of testing expoeriance. Right now I am looking for a change. Can any body help me out to find a job in south india. Thanks in Advance

1418