comp.lang.ada
 help / color / mirror / Atom feed
From: Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
Subject: Re: Ada 0Y plans for garbage collection?
Date: Mon, 15 Sep 2003 15:33:30 +0200
Date: 2003-09-15T15:33:30+02:00	[thread overview]
Message-ID: <fkdbmvoecnqq6bm7vjamo4ei6l7pdn8375@4ax.com> (raw)
In-Reply-To: 3F62004D.6080704@attbi.com

On Fri, 12 Sep 2003 17:20:27 GMT, "Robert I. Eachus"
<rieachus@attbi.com> wrote:

>Dmitry A. Kazakov wrote:
>
>> But reference counting could be made much more easy and attractive if
>> smart pointers have more light-weighted implementation than controlled
>> types in generic packages. There are too many problems with that...
>
>Agreed, which is why you want to use a reference counted storage pool. 
>That way the count is stored with the object, and you only incur the 
>overhead when you create a new counted access value.

Sounds great, really!

It also solves nasty problems when a GC object is allocated on the
stack, or with [unsupported] MI (:-)), because the reference count is
no more a part of the object.

But I suppose that this would require massive compiler support. If so,
then why not to make access types to counted storage pool more
transparent. At least when:

1. passing to a subprogram expecting the designated object.

2. dispatching. Named access types do not dispatch and define no
primitive operations.

I mean, to finally kick GC off, access types to reference counted
objects should fully mimic the designated types. I.e. ".all" dropped,
"null" is not a valid value etc. AFAIK access types with no "null" are
planned (?), so dropping ".all" would be a logical consequence.
Assignment should then just copy the reference. BUT, what about
cloning [non-limited] objects when they are modified through a counted
access, while the reference count is greater than 1? This is not so
easy.

>I've done this to create a pool of fixed sized objects.  I keep 
>intending to rewrite it to support variable sized objects, but it is 
>always easier to create a fixed-sized reference-counted object with an 
>access value into the normal heap, and do explicit deallocation of that 
>object when the reference count reaches zero.
>
>Anyone want to work with me on a "standard" reference counted storage 
>pool for Ada 200Y?  The storage pool will only be a couple of pages of 
>code.  The real effort is in documenting it and providing examples of use.

If I can help...

>Or did you mean that the fact that the storage pool was a controlled 
>type was a problem?

No. The problem was that the reference type has to be controlled.

> I don't see that.  Typically a program will create 
>a storage pool once and then just use it.  The controlled overhead 
>really only comes into play if the storage pool is located inside a 
>nested procedure.

---
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de



  parent reply	other threads:[~2003-09-15 13:33 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-09 13:35 Ada 0Y plans for garbage collection? Jano
2003-09-09 16:24 ` Martin Krischik
2003-09-09 18:30 ` Jeffrey Carter
2003-09-10  6:55   ` olehjalmar kristensen - Sun Microsystems - Trondheim Norway
2003-09-11 15:09     ` Martin Krischik
2003-09-11 21:21       ` Robert I. Eachus
2003-09-12  8:43         ` Dmitry A. Kazakov
2003-09-12 15:38           ` Martin Krischik
2003-09-15 13:33             ` Dmitry A. Kazakov
2003-09-16 18:04               ` Martin Krischik
2003-09-12 15:49           ` Martin Krischik
2003-09-14 19:26             ` Matthew Heaney
2003-09-14 21:46             ` Berend de Boer
2003-09-14 21:58               ` Ludovic Brenta
2003-09-15  1:43                 ` Robert I. Eachus
2003-09-16 16:48                   ` Jon S. Anthony
2003-09-16 21:45                 ` Berend de Boer
2003-09-17  1:39                   ` Jeffrey Creem
2003-09-17  3:38                     ` Larry Kilgallen
2003-09-17 14:14                     ` Jon S. Anthony
2003-09-17 17:23                     ` Gautier Write-only
2003-09-18  0:39                     ` Berend de Boer
2003-09-18 16:52                     ` chris
2003-09-22 15:51                       ` Robert I. Eachus
2003-09-22 16:29                         ` Warren W. Gay VE3WWG
2003-09-22 16:30                         ` chris
2003-09-23  9:26                         ` Dmitry A. Kazakov
2003-09-24  1:46                           ` Nick Roberts
2003-09-24 14:28                             ` Maxim S. Shatskih
2003-09-24 16:01                               ` Preben Randhol
2003-09-24 16:52                                 ` Stephane Richard
2003-09-24 17:19                                   ` chris
2003-09-25 17:49                                 ` OT " Pascal Obry
2003-09-25 19:30                                   ` Pascal Obry
2003-09-25 20:32                                   ` tmoran
2003-09-26 18:57                                     ` Pascal Obry
2003-09-27  0:40                                       ` Stephane Richard
2003-09-27  8:05                                         ` Preben Randhol
2003-09-27 10:01                                         ` chris
2003-09-24 16:33                               ` Time Taken to Boot Nick Roberts
2003-09-24 20:11                                 ` Mark A. Biggar
2003-09-25 15:14                                   ` Maxim S. Shatskih
2003-09-25 17:29                                     ` Warren W. Gay VE3WWG
2003-09-25 15:00                             ` Ada 0Y plans for garbage collection? Robert C. Leif
2003-09-12 17:20           ` Robert I. Eachus
2003-09-13  9:54             ` Martin Krischik
2003-09-13 20:37               ` Robert I. Eachus
2003-09-15 13:33             ` Dmitry A. Kazakov [this message]
2003-09-15 21:17               ` Alexander Kopilovitch
2003-09-14 19:10     ` Matthew Heaney
2003-09-15  6:48       ` Martin Krischik
2003-09-14 13:19 ` Matthew Heaney
replies disabled

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