This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: a confusion regarding role of schedlock


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]