comp.lang.ada
 help / color / mirror / Atom feed
* Tasking problem (delay)
@ 2007-08-15 17:04 Gerd
  2007-08-15 17:34 ` Georg Bauhaus
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Gerd @ 2007-08-15 17:04 UTC (permalink / raw)


Hi all,

I have a problem with some code. Maybe I misunderstood the LRM. Can
someone explain and maybe show a solution?

First I have to say, I work with GNAT on Windows, but what I try is to
simulate the behavior of an embedded processor (which is currently
programmed in C).

I have three tasks (much reduced from real  world task), one for
startup, one for receiving data and one for processing it:

WD_Delay: Duaration := 1000.0; -- so do not trigger on start

task startup is
end startup;

task receiver is
end receiver;

task worker is
  entry Data(...);
end worker;

task body startup is
begin
  ...
 WD_Delay := 1.0;
 ...
end startup;

task body receiver is
begin
   loop
     ... -- receive data
    worker.Data (...);
  end loop;
end receiver;

task body worker is
begin
  loop
    select
       accept Data (...)
   or
     delay WD_Timeout;
     trigger_WD;
    end select;
  end loop;
end worker;


So what I expected was, that after the init-task set the new delay,
the worker would trigger the watchdog in short intervalls. But it
seems, that the delay still waits for the initial delay time.
Whats wrong?

Thanks,
Gerd




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

end of thread, other threads:[~2007-08-19 18:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-15 17:04 Tasking problem (delay) Gerd
2007-08-15 17:34 ` Georg Bauhaus
2007-08-15 18:32 ` Jeffrey R. Carter
2007-08-19  9:50   ` Gerd
2007-08-19 18:26     ` Jeffrey R. Carter
2007-08-16  5:16 ` anon
2007-08-16  5:17 ` AW: " Grein, Christoph (Fa. ESG)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox