public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Jonathan Larmour <jlarmour@redhat.co.uk>
To: yyl <ylyuan@csrd.org>
Cc: ecos <ecos-discuss@sourceware.cygnus.com>
Subject: Re: [ECOS] about timeslice and  same priority thread switch.
Date: Tue, 30 May 2000 14:47:00 -0000	[thread overview]
Message-ID: <393436D7.104D0E0B@redhat.co.uk> (raw)
In-Reply-To: <002001bfc9d5$a9f843a0$2901a8c0@21>

> yyl wrote:
> 
> Hi, after finished building the ecos1.3.1 on Redhat linux6.1(target is pc
> x86),I use gdb stub and the example twothreads.c to test.
> From the document and the code of kernel,I think the threads of same
> priority should switch by timeslice.But after comment the sentence in
> twothreads.c as followed:
>           cyg_thread_delay(200);
> I find no switch.Who can tell me why?

So you are saying that by changing the code to the following, it stops
working?

  printf("Beginning execution; thread data is %d\n", message);
 
/*  cyg_thread_delay(200); */
 
  for (;;) {
    delay = 200 + (rand() % 50);
 
    /* note: printf() must be protected by a
       call to cyg_mutex_lock() */
    cyg_mutex_lock(&cliblock); {
      printf("Thread %d: and now a delay of %d clock ticks\n",
             message, delay);
    }
    cyg_mutex_unlock(&cliblock);
    cyg_thread_delay(delay);
  }

Are you sure you didn't change anything in your configuration from the
default that you didn't mean to?

> I think the switch of thread
> invoked by dsr of real time clock interrupt.Is that right?

Yes. See Cyg_RealTimeClock::dsr() in kernel/VERSION/src/common/clock.cxx

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

  reply	other threads:[~2000-05-30 14:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-29 18:27 yyl
2000-05-30 14:47 ` Jonathan Larmour [this message]
2000-05-30 18:40   ` yyl
2000-05-31 13:13     ` Jonathan Larmour
2000-06-01  3:02       ` [ECOS] Configuration tool problem Alessandro Pinto
2000-06-01  8:03         ` [ECOS] " Jonathan Larmour
2000-06-01  8:57           ` Alessandro Pinto
2000-06-01  9:08             ` Jonathan Larmour
2000-06-01 22:31       ` [ECOS] about timeslice and same priority thread switch zhang
2000-06-02 11:12         ` Jonathan Larmour

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=393436D7.104D0E0B@redhat.co.uk \
    --to=jlarmour@redhat.co.uk \
    --cc=ecos-discuss@sourceware.cygnus.com \
    --cc=ylyuan@csrd.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).