comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: Problem with task component
Date: Mon, 24 Sep 2012 15:37:41 +0200
Date: 2012-09-24T15:37:41+02:00	[thread overview]
Message-ID: <k3pnmv$o94$1@dont-email.me> (raw)
In-Reply-To: <m2r4pr7rsa.fsf@pushface.org>

Le 24/09/2012 10:23, Simon Wright a écrit :
> The language in ARM9.3 is, now you point it out, quite opaque,
> especially if you approach it with wrong assumptions.
[good explanation snipped]

The principle of the "terminate" is that a task terminates automatically
if it can be proven that its entries cannot be called.

Since a task is not visible outside its master*, any task that can call
T must depend on the same master as T. Therefore, T can terminate if its
master is completed, and every task depending on the master is either
completed or waiting on a terminate alternative.

However, imagine that the master (M) itself is waiting on a terminate
alternative. If M is revived, it could in turn call T. Therefore, the
previous reasoning must be extended to M's master, and so on. I hope
this makes the wording more understandable:

"the open terminate_alternative is selected if and only if the following
conditions are satisfied:
- The task depends on some completed master; and
- Each task that depends on the master considered is either already
terminated or similarly blocked at a select_statement with an open
terminate_alternative.

When both conditions are satisfied, the task considered becomes
completed, together with all tasks that depend on the master considered
that are not yet completed."

Now, if one of the tasks in the whole family is allowed to wake-up due
to expiration of a delay statement, it could call T (directly or
indirectly), and wake up the whole gang. Therefore, terminate could
never be selected for the task that has the delay - implying that
terminate could not be selected for any other task in the family.

------
* except for the infamous "rosen pathology" in Ada 83 that was
exterminated in Ada 95

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr



  reply	other threads:[~2012-09-29 16:33 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-19 18:22 Problem with task component Simon Wright
2012-09-19 18:48 ` Dmitry A. Kazakov
2012-09-19 20:40   ` Simon Wright
2012-09-19 21:11     ` Dmitry A. Kazakov
2012-09-19 21:48       ` Simon Wright
2012-09-24  5:28         ` J-P. Rosen
2012-09-24  8:23           ` Simon Wright
2012-09-24 13:37             ` J-P. Rosen [this message]
2012-09-24 14:17               ` Simon Wright
2012-09-24 17:53               ` Robert A Duff
2012-09-24 20:40                 ` J-P. Rosen
2012-09-24 15:44             ` Adam Beneschan
2012-09-24 16:13               ` AdaMagica
2012-09-24 16:43                 ` Adam Beneschan
2012-09-24 16:29               ` Dmitry A. Kazakov
2012-09-24 20:49                 ` J-P. Rosen
2012-09-25  7:35                   ` Dmitry A. Kazakov
2012-09-25 17:52                     ` J-P. Rosen
2012-09-25 18:35                       ` Dmitry A. Kazakov
2012-09-25 19:22                         ` J-P. Rosen
2012-09-26  7:27                           ` Dmitry A. Kazakov
2012-09-26 11:49                             ` Georg Bauhaus
2012-09-26 14:13                               ` Dmitry A. Kazakov
2012-09-19 19:44 ` Adam Beneschan
replies disabled

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