This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: newbie query! spinlocks mlqueue
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: jeane <jeane dot genet at gmail dot com>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: 20 Dec 2005 16:04:55 +0000
- Subject: Re: [ECOS] newbie query! spinlocks mlqueue
- References: <53aae5ff0512200224x175896dcv4bcbf68bfdf69e51@mail.gmail.com>
jeane <jeane.genet@gmail.com> writes:
> bonjour!
> I was browsing through the code looking for implemantation pour the
> spinlock in uni-processor modes. All it does is is add one to the
> flag! What happens if there are two threads (with mlqueue based
> scheduling preemption enabled) and thread A acquire spinlocks and gets
> scheduled out and thread B tries to acquire the spinlock ? It look it
> will acquire the spinlock :-S I miss something? how does spinlock
> (cyg_spinlock_spin)disables scheduling?
> Excuse my poor englais, any help will be grateful.
> Thank you,
> Jeane.
Take a look at the spinlock documentation, it explains there the
situations in which spinlocks are appropriate and the potential
pitfalls of using then inappropriately:
http://ecos.sourceware.org/docs-latest/ref/kernel-spinlocks.html
--
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