This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: a confusion regarding role of schedlock
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: Brij Bihari Pandey <fuzzhead012 at yahoo dot com>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: 13 Sep 2002 15:30:57 +0100
- Subject: Re: [ECOS] a confusion regarding role of schedlock
- References: <20020913083618.12502.qmail@web21009.mail.yahoo.com>
Brij Bihari Pandey <fuzzhead012@yahoo.com> writes:
> Thanks Rich,
>
> but my confusion is about - we took sched lock as we
> didn't want the threadswitch to happen, yet because of
> reschedule the threadswitch will happen.
Yes. Because at the point at which we call reschedule() we want other
threads to run. We have put the current thread to sleep on the
semaphore's queue, it is no longer runnable. reschedule() effectively
zeros the scheduler lock, allowing other threads to run, and resets
the scheduler lock to its original value when the current thread is
released from its wait. -- but it does all this in a more efficient
and race-free manner.
--
Nick Garnett - eCos Kernel Architect
http://www.eCosCentric.com/
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss