What is mutex precisely used for?

Answers were Sorted based on User's Feedback



What is mutex precisely used for?..

Answer / rohil

The mutex (mutually exclusion) variables are used thread
synchroniization and for protecting the shared memory(data
segment) when multiple writes occur

Is This Answer Correct ?    23 Yes 0 No

What is mutex precisely used for?..

Answer / achal

The above is correct. To be more specific, a CPU might need
to access some hardware device say I2c interface. Now if 2
processes in running state try to acquire and use I2c for
some data transfer, it might create problems, when one of
them hasn't finished its operations with the device. So
whenever some process has to make use of I2C it should lock
upon the mutex object for I2c device. And after the
operation gets finished it unlocks the mutex. Now some
other process can use I2c by mutex lock.
Similarly mutex object can be used to safegaurd some other
device resources.

Is This Answer Correct ?    22 Yes 4 No

Post New Answer

More Embedded Systems AllOther Interview Questions

what is difference between micro processor & micro controller ?

8 Answers   Bosch,


Have you designed ui, user interface?

0 Answers  


Hi Guru here.......my question is....... Is it necessary to start the execution of a program from the main() in C?

4 Answers  


What is an embedded system and why it is used?

0 Answers  


What kinds of problems can you hit with lockless model?

0 Answers  






Why is model transformations used in the embedded system?

0 Answers  


look at following code void foo(void) { unsigned int a = 6; int b = -20; int c = (a+b > 6) ? 1:0; } o/p is 1 why explain promotion rules

1 Answers  


Explain me what is the difference between microprocessor and microcontroller?

0 Answers  


What do you do when you get stuck with a problem you can't solve?

0 Answers  


What is endianness of a system and how do different systems communicate with each other?

0 Answers  


Are you still writing code? Do you love it?

0 Answers  


Tell me how does the interrupts handle by using the threads?

0 Answers  


Categories