This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: About Cyg_Scheduler::unlock_inner
- To: Rafael Rodríguez Velilla <rrv at tid dot es>
- Subject: Re: [ECOS] About Cyg_Scheduler::unlock_inner
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Tue, 22 May 2001 21:49:56 +0100
- Cc: ecos <ecos-discuss at sourceware dot cygnus dot com>
- Organization: Red Hat UK Ltd.
- References: <3B0ABE79.A4CA4B8B@tid.es>
Rafael Rodríguez Velilla wrote:
>
> I'm working with eCos 1.3.1 and I have a question about
> Cyg_Scheduler::unlock_inner.
>
> This method is only called when calling Cyg_Scheduler::unlock with
> sched_lock=1; (so it should become 0)
> I have seen in the code that it first calls any pending DSR (if there
> is any) and then it checks if there's a new thread that reclaims the
> CPU.
> Why is the context of the new thread restored before decrementing
> sched_lock?
You can't be in the process of switching the context when there's a chance
the system could be rescheduled again (e.g. due to a new interrupt).
> Why is not the new thread run with the scheduler unlocked?
Once it is restored, it unlocks the scheduler almost straight away.
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine