public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] another context switch query..
@ 2006-06-21  7:15 saurabh prakash
  2006-06-24 11:38 ` Robin Randhawa
  0 siblings, 1 reply; 2+ messages in thread
From: saurabh prakash @ 2006-06-21  7:15 UTC (permalink / raw)
  To: ecos-discuss

I would like to know what happens when a (ruuning)thread has locked the
scheduler, and an interrupt occurs.

1) Does the ISR and/or DSR run.
2) what would exactly be the sequence in this case.

thanks in advance
saurabh

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] another context switch query..
  2006-06-21  7:15 [ECOS] another context switch query saurabh prakash
@ 2006-06-24 11:38 ` Robin Randhawa
  0 siblings, 0 replies; 2+ messages in thread
From: Robin Randhawa @ 2006-06-24 11:38 UTC (permalink / raw)
  To: ecos-discuss; +Cc: saurabh prakash

Hi Saurabh.

On Wednesday 21 June 2006 12:44, saurabh prakash wrote:
> I would like to know what happens when a (ruuning)thread has locked the
> scheduler, and an interrupt occurs.

You really should be :

a. Googling the archives (this one's been asked a gazillion times)
b. Reading the code (one of eCos' strengths is its easily readable code)

> 1) Does the ISR and/or DSR run.
> 2) what would exactly be the sequence in this case.

Short(ish) answer :

If Interrupts have been explicitly disabled, then ISRs will not run. 
Consequently, DSRs won't run either.

On the other hand, if a thread has locked the scheduler, then a scheduler 
count variable has been incremented internally. A non-zero count means that 
even if an ISR 'marks' a DSR for later execution, the DSR will NOT be 
executed. This is because locking the scheduler implies that the current 
thread doesn't want to be switched out just yet. If DSRs were allowed to run, 
then a DSR could perform an action - such as a semaphore post perhaps - which 
could 'mark' a higher priority thread as runnable - and that would cause a 
reschedule once the DSRs were all done.

Cheers,
Robin

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-24 11:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-21  7:15 [ECOS] another context switch query saurabh prakash
2006-06-24 11:38 ` Robin Randhawa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).