> Marcus Högberg wrote:
> >
> > This might be a stupid question, but anyway, here goes.....
> > What (if any) is the difference between Mutex and Semaphores?
> > I'm interested because I'm writing a paper on RTLinux as an examreport
> >
>
> Classically semaphore can have a value (other than 1 or 0), mutexes are
> either on or off.  Usually access to a semaphore is protected by an
> (internal) mutex.
>

There is another difference.  With a mutex the thread that locked it is the
only thread that can unlock it again, hence the mutual exclusion.  With
semphores any thread can take the semaphore and any thread post it again.
This is extremely usefull especially with binary semaphores.

Simon


-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to