answersLogoWhite

0

Can you explain for what is mutex used?

Updated: 8/20/2019
User Avatar

Wiki User

10y ago

Best Answer

The uses of a mutex can indeed be described, however some of the more notable uses are that of cleaning and disinfecting area so that germs can not be spread from area to area.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you explain for what is mutex used?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the role of mutex in IPC?

contct to damit for this.


What is priority inversion?

Priority inversion is a situation where in lower priority tasks will run blocking higher priority tasks waiting for resource (mutex). For ex: consider 3 tasks. A, B and C, A being highest priority task and C is lowest. Look at sequence of context swaps A goes for I/O . unlocks mutex. C was ready to run. So C starts running. locks mutex B is ready to run. Swaps out C and takes mutex. A is ready to run. but A is blocked as mutex is locked by B. but B will never relinqishes the mutex as its higher priority than C. The solution to priority inversion is Priority inheritance.


How to write c programme of Sleeping-barber problem in opertating system?

#define CHAIRS 5 /* # chairs for waiting customers */ typedef int semaphore; /* use your imagination */ semaphore customers = 0; /* # of customers waiting for service */ semaphore barbers = 0; /* # of barbers waiting for customers */ semaphore mutex = 1; /* for mutual exclusion */ int waiting = 0; /* customer are waiting (not being cut) */ void barber(void) { while (TRUE) { down(&customers); /* go to sleep if # of customers is 0 */ down(&mutex); /* acquire access to "waiting' */ waiting = waiting - 1; /* decrement count of waiting customers */ up(&barbers); /* one barber is now ready to cut hair */ up(&mutex); /* release 'waiting' */ cut_hair(); /* cut hair (outside critical region */ } } void customer(void) { down(&mutex); /* enter critical region */ if (waiting < CHAIRS) { /* if there are no free chairs, leave */ waiting = waiting + 1; /* increment count of waiting customers */ up(&customers); /* wake up barber if necessary */ up(&mutex); /* release access to 'waiting' */ down(&barbers); /* go to sleep if # of free barbers is 0 */ get_haircut(); /* be seated and be served */ } else { up(&mutex); /* shop is full; do not wait */ } }



Explain how absolute and comparative advantages were used in your simulation?

Explain how absolute and comparative advantage were used in your simulation.


How do you explain what role psychology has in depression?

Psychology plays a crucial role in understanding, diagnosing, and treating depression. Psychologists can help individuals identify triggers, develop coping strategies, and challenge negative thought patterns contributing to depression. They also utilize various therapies such as cognitive-behavioral therapy to help individuals manage their symptoms and improve their quality of life.


What is a familiar idea used to explain unfamiliar facts is a what?

Theories are familiar ideas used to explain unfamiliar facts.


What types of statement can be used to explain the steps of a proof?

The corollaries types of statement is what is used to explain the steps of a proof.


Who used the power of reason to explain society?

Enlightenment Thinkers used the power of reason to explain how society works.


What types of the statement can be used to explain the steps of a proof?

The corollaries types of statement is what is used to explain the steps of a proof.


How aerodynamics used in vehicles explain with example?

they are used.


Who used the power to reason of explain how society works?

Enlightenment Thinkers used the power of reason to explain how society works.


What is a general rule used to explain a specific event is called?

A general rule used to explain a specific event is called?