public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] alarm
@ 2001-01-18 19:21 Paleologos Spanos
  2001-01-18 19:56 ` Jonathan Larmour
  0 siblings, 1 reply; 2+ messages in thread
From: Paleologos Spanos @ 2001-01-18 19:21 UTC (permalink / raw)
  To: ecos-discuss

  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?  


  Thank you.


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

* Re: [ECOS] alarm
  2001-01-18 19:21 [ECOS] alarm Paleologos Spanos
@ 2001-01-18 19:56 ` Jonathan Larmour
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Larmour @ 2001-01-18 19:56 UTC (permalink / raw)
  To: Paleologos Spanos; +Cc: ecos-discuss

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

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

end of thread, other threads:[~2001-01-18 19:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-18 19:21 [ECOS] alarm Paleologos Spanos
2001-01-18 19:56 ` Jonathan Larmour

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).