47.0k views
1 vote
Mutual exclusion can be provided by the

a) mutex locks
b) binary semaphores
c) both (a) and (b)
d) none of the mentioned

1 Answer

4 votes

Final answer:

The correct answer is c) both (a) and (b). Mutual exclusion can be provided by both mutex locks and binary semaphores.

Step-by-step explanation:

The correct answer is c) both (a) and (b). Mutual exclusion can be provided by both mutex locks and binary semaphores. Mutex locks are widely used in operating systems to ensure that only one thread can access a shared resource at a time. Binary semaphores can also be used to enforce mutual exclusion by allowing only one process to access a shared resource at a time.

For example, imagine a scenario where two threads need to access a shared file. By using a mutex lock, each thread can acquire the lock before accessing the file, ensuring that only one thread can access the file at a time. Similarly, binary semaphores can be used to control access to a shared resource, such as a database, by allowing only one process to access it at a time.

User Czarina
by
8.3k points