public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "ariga masahiro" <ariga@link-lab.co.jp>
To: "Andrew Lunn" <andrew@lunn.ch>
Cc: <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] When or on what condition does "deschedule" happen?
Date: Mon, 19 May 2008 05:32:00 -0000	[thread overview]
Message-ID: <001901c8b971$a14202c0$1c0110ac@ariga> (raw)
In-Reply-To: <20080516125053.GA27629@lunn.ch>

Hello everyone,

Thank you,Andrew, for your reply.
There is one unclear point that I would make it clear.

In explaning it ,let me use the scenario that
Anthony J. Massa elaborate in his book
"Embedded Software Development With Ecos".
(supposing since I bought the book I don't infringe its licence)

In case of Multilevel Queue Scheduler,
three threads are created like next.

ThreadC -- priority 30(lower)
ThreadA,B -- priority 0(highest)

    - ThreadA - Timeslice - ThreadB -Deschedule - ThreadA -
  | 
|
Preemption 
Deschedule
  | 
|
ThreadC 
ThreadC

Next is Anthony J. Massa's description.
"three threads-Thread A, Thread B, and Thread C-
are configured during creation of the threads at priority levels 0, 0, and 
30, respectively.
 --- starts with Thread C executing.
 Next, Thread A becomes able to run, causing Thread C to be preempted and a 
context
switch occurs. During the execution of Thread A, Thread B also becomes able 
to run. Thread A
continues until its timeslice period expires. Then, another context switch 
occurs allowing Thread
B to run. Thread B completes within its given timeslice period. The 
de-scheduling of a thread
can happen for various reasons; for example, by waiting on a mutex that is 
not free or delaying
for a specified amount of time. Since Thread A has the highest priority of 
tasks waiting to execute,
a context switch occurs and it runs next. After Thread A has completed, a 
context switch
takes place allowing Thread C to execute."

My question is last part of Deschedule when ThreadC resumes execution.

Am I correct in assuming that among your conditions, only two conditions 
should be fullfiled to make it possible
for ThreadC to resume execution ?
1.When the thread blocks.(How does scheduler recognise this ?)
2.When a thread exits.

If ThreadA does not finish and enter looping state,then isn't there any way 
for ThreadC to resume execution ?

Please kindly forgive my ignorance and enlighten me.
Thanks in advance.

Masahiro Ariga



> On Fri, May 16, 2008 at 05:12:30PM +0900, ariga masahiro wrote:
>> Hello everyone,
>>
>> Please teach me about eCos Thread Scheduler.
>> When or on what condition does "deschedule" happen ?
>
> When the thread blocks.
>
> When a higher priority thread becomes runnable.
>
> When a thread uses up its time slice and there is another thread of
> the same priority which is runnable.
>
> When a thread calls yield and there is another thread of the same
> priority which is runnable.
>
> When a thread exits.
>
> There is nothing unusual here. Any good book on operating systems will
> teach you the same.
>
>     Andrew
>
> -- 
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>
>
> 



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

  reply	other threads:[~2008-05-19  5:32 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-07 23:59 [ECOS] Wrongfully compiled code ariga masahiro
2008-01-08  0:05 ` Gary Thomas
2008-01-08  1:05   ` ariga masahiro
2008-01-17 19:21     ` [ECOS] " Dave Lawrence
2008-01-17 23:50       ` ariga masahiro
2008-01-18 12:16         ` Dave Lawrence
2008-01-18 14:40           ` Gregg Levine
2008-01-18 15:44             ` Dave Lawrence
2008-01-18 15:49               ` Gregg Levine
2008-01-18 16:09                 ` Dave Lawrence
2008-01-21  0:34           ` ariga masahiro
2008-02-04  1:49           ` ariga masahiro
2008-02-04 11:38             ` Dave Lawrence
2008-02-12  1:06               ` ariga masahiro
2008-02-12 10:55                 ` Dave Lawrence
2008-02-22  4:57   ` [ECOS] How to re-install newly compiled gnutools ariga masahiro
2008-02-22  7:15     ` ariga masahiro
2008-05-16  8:13       ` [ECOS] When or on what condition does "deschedule" happen? ariga masahiro
2008-05-16 15:26         ` Andrew Lunn
2008-05-19  5:32           ` ariga masahiro [this message]
2008-05-19 13:18             ` Andrew Lunn
2008-05-19 13:31               ` Gary Thomas
2008-05-20  1:26               ` ariga masahiro
2008-05-20 12:18                 ` Andrew Lunn
2008-05-23  7:38                   ` ariga masahiro
2008-05-23  9:35                     ` Nick Garnett
     [not found]                   ` <000601c8c165$406e0970$1c0110ac@ariga>
2008-05-29 18:23                     ` [ECOS] Re: In trouble of timer operations Andrew Lunn
2008-05-30  2:50                       ` ariga masahiro
2008-05-30  3:09                         ` Paul D. DeRocco
2008-05-30  4:11                           ` ariga masahiro
2008-05-30  4:43                             ` Paul D. DeRocco
2008-05-30  7:26                               ` ariga masahiro
2008-05-30  7:47                                 ` Paul D. DeRocco
2008-05-30  8:03                                   ` ariga masahiro
2008-05-30  8:07                                 ` Andrew Lunn
2008-06-04  5:25                                   ` ariga masahiro
2008-06-04 10:06                                     ` Paul D. DeRocco
2008-06-05  6:14                                       ` ariga masahiro
2008-06-05 17:39                                         ` Paul D. DeRocco
2008-05-30  6:35                             ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='001901c8b971$a14202c0$1c0110ac@ariga' \
    --to=ariga@link-lab.co.jp \
    --cc=andrew@lunn.ch \
    --cc=ecos-discuss@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).