TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Proportional Font
Show HTML Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Robert I. Eachus" <[log in to unmask]>
Reply To:
Robert I. Eachus
Date:
Wed, 13 May 1998 14:40:18 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (22 lines)
At 12:13 AM 5/13/98 -0500, Stanley Allen wrote:
>The single global reference count is to keep
>track of "database interface" objects.  There is
>a single count because there is one database, in
>shared memory.  The shared memory is allocated
>via OS calls when the ref count > 0, deallocated
>when the ref count = 0.

   Not the Ada way. ;-)  Seriously, if you do need to keep track of the
users of some global object, the best way is to use some sort of a list.
This way you don't have to worry about the (hopefully very rare) cases
where an object gets Finalized twice, or Finalized without complete
Initialization.  There are list structures where removing an item from a
list is atomic, and adding to and deleting from the list, and checking for
zero length are all O(1) operations.

                                        Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...

ATOM RSS1 RSS2