How does a semaphore differ from a mutex in terms of signaling and resource access?

  • Binary
  • Counting
  • Deadlock
  • Thread blocking
Semaphores and mutexes differ in signaling and resource access. A semaphore can handle multiple resources by using a counting mechanism, allowing multiple threads to access resources concurrently. It uses signals to manage resource availability. On the other hand, a mutex is binary, meaning it only allows one thread access to a resource at a time, using a blocking mechanism to prevent other threads from accessing the resource until it's released.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *