Continue to Site

Why choose semaphore

Status
Not open for further replies.

Daljeet12

Member level 4
Member level 4
Joined
Jun 16, 2018
Messages
78
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
649
Hello everyone,

Could someone please explain semaphores in a way that's easy to understand, and perhaps provide some practical examples of how they're used in real-world scenarios within an OS?


Let's say we have a shared resource, like a printer, that multiple threads need to use concurrently. We want to ensure that only one thread can print at a time to avoid conflicts. What would you use mutex or semaphore.

Thank you in advance."
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top