[ECOS] a confusion regarding role of schedlock

Nick Garnett nickg@ecoscentric.com
Fri Sep 13 08:00:00 GMT 2002


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



More information about the Ecos-discuss mailing list