comp.lang.ada
 help / color / mirror / Atom feed
From: mfb@mbunix.mitre.org (Michael F Brenner)
Subject: Re: Ada Task priorities
Date: 1997/01/27
Date: 1997-01-27T00:00:00+00:00	[thread overview]
Message-ID: <5cj01d$oft@top.mitre.org> (raw)
In-Reply-To: kmradke-2601971335300001@dip7.inav.net


Responding to the question about making tasks A, B, and C run 
sequentially, such that B does not start until A finished, and 
C does not start until A and B finishes. 

This is not a task priority question. Task priorities determine when
a task may start with respect to other tasks starting, not with respect
to their finishing. This is a sequential requirement which must be
programmed sequentially. One way to do this is to invoke entry points
in the 3 tasks like this: 
    loop
      if a is ready then a; 
                         if b is ready then b;
                                            if c is ready then c;
                                            end if;
                         end if;
      elsif b is ready then 
                         if c is ready then c;
                         end if;
      elsif c is ready then
                         c;
      end if;
    end loop;

Of course, then there is no reason to make a, b, and c tasks at all.
Instead the above code could be the main loop of a single task.





  parent reply	other threads:[~1997-01-27  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-26  0:00 Ada Task priorities Kevin Radke
1997-01-26  0:00 ` Jonathan Polley
1997-01-27  0:00   ` Geert Bosch
1997-01-26  0:00 ` Robert Dewar
1997-01-28  0:00   ` Robert I. Eachus
1997-01-27  0:00 ` Geert Bosch
1997-01-27  0:00 ` Michael F Brenner [this message]
1997-01-28  0:00   ` Kevin Radke
replies disabled

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