comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@TheWorld.com>
Subject: Re: Ada.Strings.Fixed.Count raises Storage_Error
Date: Wed, 29 Jun 2016 16:30:45 -0400
Date: 2016-06-29T16:30:45-04:00	[thread overview]
Message-ID: <wccr3bfu496.fsf@TheWorld.com> (raw)
In-Reply-To: dtifmjFl15cU1@mid.individual.net

Niklas Holsti <niklas.holsti@tidorum.invalid> writes:

> Thanks for this information, Jean-Paul. 

Jean-Pierre.

> ...According to your post in
> http://computer-programming-forum.com/44-ada/cdf3e22c34c4de36.htm, this
> "pathology" was present in Ada 83, but was cured in Ada 95: "It was
> related to a function returning a local  task object, which is no more
> allowed."

Yes, but that was a bad design.  Ada 2005 fixed the problem in 
the right way.  It's unfortunate that we had  to introduce
incompatibilities along the way, instead of figuring out the right way
in the first place.

> This suggests to me that the definition of Ada 83 was either ambiguous
> in this case, ...

No, it was not ambiguous.  It might have surprised the language
designers, but the Ada 83 RM was clear: you could return a task
outside its master, and that task must be terminated by that time.

>...or required too much effort from the implementation for
> this feature compared to the benefits of the feature, ...

The benefits were exactly zero, so ANY implementation effort was "too
much".  But the real problem was that without heroic efforts,
implementations would be forced to leak memory.

I know of one Ada 83 implementation that counted the tasks as they were
terminated.  For the first 10, it did not free memory.  After that, it
did.  It just so happens that the ACVC test for this malfeature created
10 tasks, and made sure they still existed (in the terminated state)
after the function return.

>...and consequently
> the language was changed to eliminate the feature.

Yes, but the issue was bigger than just tasks.  Function return is
always by copy in Ada 83, and limited types (including those containing
tasks) should not be copied, but the RM required them to be copied
anyway.  Limited types didn't really work right until Ada 2005.

- Bob


  parent reply	other threads:[~2016-06-29 20:30 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-12 11:36 Ada.Strings.Fixed.Count raises Storage_Error Xavier Petit
2016-05-12 15:22 ` Tero Koskinen
2016-05-12 22:05 ` Georg Bauhaus
2016-06-26 21:18   ` Victor Porton
2016-06-26 23:23     ` rieachus
2016-06-27  0:21       ` Jeffrey R. Carter
2016-06-27  4:00         ` rieachus
2016-06-27  0:51       ` Xavier Petit
2016-06-27  4:48         ` rieachus
2016-06-28 18:25           ` Xavier Petit
2016-06-29 18:49           ` Niklas Holsti
2016-06-29 19:40             ` Jeffrey R. Carter
2016-06-29 19:57             ` Dmitry A. Kazakov
2016-07-01 11:48               ` rieachus
2016-07-01 13:08                 ` Dmitry A. Kazakov
2016-06-27  8:29       ` Simon Wright
2016-06-27  8:41         ` Georg Bauhaus
2016-06-29  8:15       ` Niklas Holsti
2016-06-29  9:13         ` J-P. Rosen
2016-06-29 17:43           ` Niklas Holsti
2016-06-29 18:19             ` J-P. Rosen
2016-06-29 20:30             ` Robert A Duff [this message]
2016-06-30  5:38               ` Niklas Holsti
2016-07-01 10:40                 ` rieachus
2016-07-01 10:55                   ` J-P. Rosen
2016-07-01 12:17                     ` rieachus
2016-07-01 12:55                       ` G.B.
2016-06-27 12:52     ` Victor Porton
2016-05-12 22:56 ` Randy Brukardt
replies disabled

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