comp.lang.ada
 help / color / mirror / Atom feed
From: geert@fozzie.sun3.iaf.nl (Geert Bosch)
Subject: Re: Ada Task priorities
Date: 1997/01/27
Date: 1997-01-27T00:00:00+00:00	[thread overview]
Message-ID: <5chpnt$klc@fozzie.sun3.iaf.nl> (raw)
In-Reply-To: kmradke-2601971335300001@dip7.inav.net


Kevin Radke (kmradke@inav.net) wrote:

   Can one guarantee that if all 3 tasks are eligible for execution
   at the same time, that task a will finish it's work before
   task b begins to run, and task c will only run after both
   tasks a and b finish? 
   
Of course not! When having a machine with more than one processor they
should run concurrently. It is perfectly legal for an implementation to
make progress in all three tasks at the same time. Using priority as
locking mechanism is very bad indeed and does not work in many cases.

   The ada83 RM seems to be pretty explicit about requiring "The
   highest priority eligible task must be executing at any given
   time", 
  
That some task is executing does not mean other tasks aren't. Even in
a single processor environment there might be smart ways of making 
progress in both tasks at once and an implementation is certainly
allowed to do that.

   My personal opinion is that using assumptions about priorities like
   this is just asking for trouble, but I thought I would get other
   people's opinions on this...

It is asking for trouble indeed. When you want to task B to wait
for task A, you should let task B wait for a rendez-vous with A.
For example in task B you say 
   accept Start do 
      null 
   end Start;
and at the end of A you call B.Start. 

Regards,
   Geert
from running you should let them make blocking calls to entries of
-- 
E-Mail: geert@sun3.iaf.nl    
      ``I think there is a world market for maybe five computers.''
        Thomas Watson,  chairman of IBM, 1943





  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 [this message]
1997-01-27  0:00 ` Michael F Brenner
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