comp.lang.ada
 help / color / mirror / Atom feed
From: "Norman H. Cohen" <ncohen@watson.ibm.com>
Subject: Re: How to wait for task completion
Date: 1996/09/18
Date: 1996-09-18T00:00:00+00:00	[thread overview]
Message-ID: <324060F8.46C8@watson.ibm.com> (raw)
In-Reply-To: DxxLKq.3BC.0.-s@inmet.camb.inmet.com


Tucker Taft wrote:

> The problem is that Ada 83 claimed that it was OK to free the task
> object associated with a task that was still running, and the task
> was not supposed to be affected.  We attempted to remain compatible
> with this rule, while also allowing more of the critical task information
> (e.g. the Task Control Block) to be held in the task object itself.
> These two rules led to task objects requiring special handling with
> respect to Free.
...
> The warning in 13.11.2(9) should have been replaced with a more carefully
> phrased "Implementation Permission."  As it is, it comes out of the blue,
> with no explanation, which is admittedly scary.

Perhaps this justifies implementation permission for attempted
deallocation
of a task object for an ACTIVE task to have no effect (as opposed, e.g.,
to
requiring the implementation to set a "deallocation-requested" flag in
the
task object, to check such flags upon task termination, and to perform
any
deferred deallocations at that time).

Unfortunately, 13.11.2(9) gives permission to ignore any deallocation of
a
task object (or of an object containing a task object), even if its task
has
terminated.  Thus the standard provides no way for a programmer
allocating 
task objects to ensure the absence of a storage leak.

I am aware of Ada-83 implementations that interpreted the note in
RM83-13.10.1(7) to mean that any attempt to deallocate a task object
--even for a terminated task--could simply be ignored.  (In my opinion,
this was a misinterpretation, based on a failure to distinguish between
the
terms "task" and "task object" in that paragraph--and a failure to
recall
that "Note" paragraphs are not part of the standard anyway!)  However,
upward compatibility with Ada 83 did not require preservation of this
behavior, since no program (intentionally) depends on a deallocation
that
it requested not taking place!

-- 
Norman H. Cohen    ncohen@watson.ibm.com    
                   http://www.research.ibm.com/people/n/ncohen




  reply	other threads:[~1996-09-18  0:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-15  0:00 How to wait for task completion wiljan
1996-09-15  0:00 ` David C. Hoos, Sr.
1996-09-20  0:00   ` Stephen & Tammy House
1996-09-15  0:00 ` Samuel Tardieu
1996-09-16  0:00   ` wiljan
1996-09-17  0:00     ` Ted Dennison
1996-09-17  0:00     ` Samuel Tardieu
1996-09-17  0:00       ` wiljan
1996-09-17  0:00       ` Norman H. Cohen
1996-09-17  0:00         ` wiljan
1996-09-18  0:00           ` Tucker Taft
1996-09-18  0:00             ` Norman H. Cohen [this message]
1996-09-18  0:00   ` Jon S Anthony
1996-09-16  0:00 ` Jon S Anthony
replies disabled

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