Thursday, April 28, 2011

Difference between semaphore and mutex

A good deeper insight with the following highlights:

1) Mutex can only be used to lock and unlock a shared resource or critical section. But, semaphore can also be used for signalling too.

2) Mutex can be unlocked only by the task itself. But, semaphore can be signalled from any other task.

3) Mutex has built-in implementation to avoid priority inversion. But, semaphore do not implement. Though binary semaphore is equivalent to mutex, it can not avoid priority inversion.

http://www.netrino.com/Embedded-Systems/How-To/RTOS-Mutex-Semaphore

No comments:

Post a Comment