1.

What Are The Different Types Of Semaphores And Where They Are Used?

Answer»

BINARY semaphore and counting semaphore. Binary semaphore is same as mutex. Binary semaphore tries to PROTECT only one resource.
Counting semaphore is USED in case of multiple resource.

For ex: we have 4 printers then the counting semaphore value will be INIT to 4. When it reaches 0, the task waiting on the semaphore is SUSPENDED.

Binary semaphore and counting semaphore. Binary semaphore is same as mutex. Binary semaphore tries to protect only one resource.
Counting semaphore is used in case of multiple resource.

For ex: we have 4 printers then the counting semaphore value will be init to 4. When it reaches 0, the task waiting on the semaphore is suspended.



Discussion

No Comment Found