This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: cyg_cond_t or cyg_semaphore_t
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: <maillist at ing-monteleone dot com>
- Cc: ecos-discuss at sourceware dot org
- Date: 28 Apr 2005 11:52:40 +0100
- Subject: Re: [ECOS] cyg_cond_t or cyg_semaphore_t
- References: <200504281034.j3SAYTRO006137@daitarn6.register.it>
<maillist@ing-monteleone.com> writes:
> I have some confusion about the use of Cyg_cond_varable_t or
> cyg_semaphore_t. I cannot see a real difference from high-level
> point of view ....
>
> Someone can explain to me the real differences ?
Semaphores are a stand-alone synchronization mechanism.
Condition variables are part of a synchronization mechanism that also
includes mutexes. Essentially they allow a thread that owns a mutex to
put itself to sleep and release the mutex atomically. Not something
you could do any other way.
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss