public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Jonathan Larmour <jlarmour@redhat.com>
To: Paleologos Spanos <paleolog@ee.ucla.edu>
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] alarm
Date: Thu, 18 Jan 2001 19:56:00 -0000	[thread overview]
Message-ID: <3A67BB06.73612F77@redhat.com> (raw)
In-Reply-To: <Pine.GSO.4.10.10101181919440.18453-100000@sierra.ee.ucla.edu>

Paleologos Spanos wrote:
> 
>   Hi,I have some questions regarding the alarm trigerring.
> 
> -will the alarm be triggered after the completion of its thread?
>  If for example the execution of a thread lasts 30 ticks and I want to
> initialize the alarm to trigger every 50 ticks and invoke a function,will
> the alarm work on this case?or it is valid only during the execution of
> the thread in which it has been created?
> 
>  Actually I would like to know if the architecture I want to write is
> feasible or not.I want this:
> 
>  i have 2 threads(i have chosen bitmap scheduler) with different
> priorities.Assuming that thread1 lasts for 30 ticks and thread2 for 40
> ticks,I want to execute from the beginning again each thread.So I want to
> run thread1 every 70 ticks and thread 2 every 100 ticks.I do not care if
> these threads have completed their execution .I just want to restart them
> every  x ticks.
>  I had in mind that setting an alarm inside these 2 threads and
> initializing it to trigger every multiple of the above period could be a
> possible solution.So,for example the alarm in thread1 would be trigger
> every 100 ticks and would invoke the function(let's say) alarm_func1 which
> would kill and resume thread2.The same with the alarm in thread2.
> 
>  But I did it and it does not seem to be feasible.
>  What am I doing wrong?Is such an application possible with ecos?

Alarms are not associated with threads. They are independent entities. The
alarm handler functions are actually called in a DSR context, not a thread
context. And if you are killing off threads, be sure that the alarms were
not created on the thread stacks. Other than that, killing and resuming a
thread from an alarm handler _should_ work.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Un cheval, pas du glue. Pas du cheval, beaucoup du glue. || Opinions==mine

      reply	other threads:[~2001-01-18 19:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-18 19:21 Paleologos Spanos
2001-01-18 19:56 ` Jonathan Larmour [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=3A67BB06.73612F77@redhat.com \
    --to=jlarmour@redhat.com \
    --cc=ecos-discuss@sources.redhat.com \
    --cc=paleolog@ee.ucla.edu \
    /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).