public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Gary Thomas <gthomas@cambridge.redhat.com>
To: mekala natarajan <mekala_natarajan@yahoo.com>
Cc: ecos-discuss@sources.redhat.com
Subject: RE: [ECOS] scheduler
Date: Mon, 14 May 2001 05:58:00 -0000	[thread overview]
Message-ID: <XFMail.20010514065842.gthomas@cambridge.redhat.com> (raw)
In-Reply-To: <20010514105409.2672.qmail@web9605.mail.yahoo.com>

On 14-May-2001 mekala natarajan wrote:
> Hi,
>    I have a doubt regarding scheduler.
> 
> i have two process one with higher priority and the
> other with lower priority.
> 
> This is the example program which i used.
> 
> 
> int main()
> {
>     xCreateProcess_i(xPclcpsSender_v,5,ZERO,0);
>     xCreateProcess_i(xPclcpr_v,7,ZERO,0);
> 
>         mProcessId_i=xGetProcessId_i();
>       xKillProcess_i(mProcessId_i);
> }
> 
> void xPclcpr_v(void)
> {
>       while(1)
>       {
>       printf("\n Receiver process is created\n");
>       xDelay_v(5);
>       }
> }
> 
> void xPclcpsSender_v(void)
> {
>       while(1)
>       {
>       printf("\n Sender process is created\n");
>       xDelay_v(3);
>       }
> }
> 
> Output:
> -------
>      Sender process is created 
>      Sender process is created
>      receiver process is created
>      Sender process is created
>      Sender process is created
>      receiver process is created
>                ----
> Why is this output. It is supposed to print Sender
> process only once.
> 

Why do you think this should be so?

> How the scheduler behaves here?
> 

I assume that xDelay_v() calls 'thread_sleep()' or some such similar
"blocking" function.

When the "receiver" process is sleeping (xDelay_v()), the "sender"
process will run, thus the printout.

> Can someone explain me?

      reply	other threads:[~2001-05-14  5:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-14  3:54 mekala natarajan
2001-05-14  5:58 ` Gary Thomas [this message]

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=XFMail.20010514065842.gthomas@cambridge.redhat.com \
    --to=gthomas@cambridge.redhat.com \
    --cc=ecos-discuss@sources.redhat.com \
    --cc=mekala_natarajan@yahoo.com \
    /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).