What is mutex precisely used for?
Answers were Sorted based on User's Feedback
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 |
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 |
What are the differences between analytical and computational modeling?
What is the difference between hard real-time and soft real-time os?
What is the size of the int, char and float data types?
How to reduce function call overhead in arm based systems
Do you know what is the function of watchdog timer in embedded system?
What is the significance of watchdog timer in embedded systems?
Do you know what is virtual memory?
Tell me what is the need for an infinite loop in embedded systems?
Have you developed software testing procedures for new systems and performed qa, quality assurance, or audits?
What is the difference between hardware design and software design?
please send me the faq's in technical interviews on cand datastructures , unix(shell scripting).
What is continuous integration? Why is it important?