hi ,
have u ever worked on RTOS?
I have doubts. kindly help to get rid of dilemma.
1) what is the difference between signal and event?
2) what is the difference between mutex and binary semaphore?
i have searched on net, but failed to clear doubts.
Can u help me?
Thanks.
Sukhdeep Singh.
RTOS
-
- Lieutenant
- Posts: 92
- Joined: Tue Oct 27, 2009 7:50 pm
Re: RTOS
I learned the Unix concepts under system programming/Inter process communication (IPC) quite a long ago that covered all these concepts in Operating Systems. I have searched the net and chosen the following answers as the best for you.
An event is an inter task signalling mechanism which can be used to send/receive/pend for an event.
Another definition is as follows.
A signal is according to the Unix terminology a notification sent to a process that will interrupt that process. In order to catch a signal a process must have a signal handler.1) what is the difference between signal and event?
An event is an inter task signalling mechanism which can be used to send/receive/pend for an event.
A mutex is essentially a binary semaphore, but with the additional property that it is logically "owned" by the executable entity (whether process or thread) that locked it. This property improves code structuring and allows some useful optimizations. You can't lock a mutex in one thread and then unlock it in another. You can, however, lock a binary semaphore in one thread and unlock it in another, because while a binary semaphore may be "locked" or "unlocked", it is never "owned".2) what is the difference between mutex and binary semaphore?
Another definition is as follows.
I recommend you to read System Programming/Inter Process Communication (based on UNIX which is the OS that introduced most of these concepts) to get a clear idea of these concepts. http://en.wikipedia.org/wiki/Inter-proc ... munication has some information. I referred the book "Operating Systems - Stallings" that covers all these concepts.A mutex is a binary semaphore that usually incorporates extra features, such as ownership, priority inversion protection or recursivity. The differences between mutexes and semaphores are that semaphores are operating system dependent, though mutexes are implemented by specialized and faster routines. Mutexes are meant to be used for mutual exclusion (post/release operation is restricted to thread that called pend/acquire) only and binary semaphores are meant to be used for event notification (post-ability from any thread) and mutual exclusion.