comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <rieachus@comcast.net>
Subject: Re: copy constructor for sockets
Date: Tue, 25 May 2004 17:50:01 -0400
Date: 2004-05-25T17:50:01-04:00	[thread overview]
Message-ID: <ePydncm_Z9kXIi7d4p2dnA@comcast.com> (raw)
In-Reply-To: <x7v8yfi77do.fsf@smaug.pushface.org>

Simon Wright wrote:

> Matthew Heaney <matthewjheaney@earthlink.net> writes:
> 
> 
>>>in which of these times you should decrement,
>>
>>Huh?  Every time, of course.  How could it be otherwise?  What would
>>a reference counting scheme even mean, if you didn't decrement the
>>refcount during finalization of the object?
> 
> I have it stuck in my head that Finalize can get called more than
> once. Which would make a mockery of (simple-minded) reference counting
> schemes, of course. Please tell me it ain't so! (or explain why it's
> not actually a problem ..)

Yes, Finalize can be called more than once, especially when exceptions 
occur.  The solution I usually use is to something else during the 
finalization, and only change the reference count if that succeeds.  In 
a reference counting scheme you need a "finalized" flag as well as an 
initialized flag, which can be different values in the same byte 
(uninitialized, valid, finalized).


-- 

                                           Robert I. Eachus

"The terrorists rejoice in the killing of the innocent, and have 
promised similar violence against Americans, against all free peoples, 
and against any Muslims who reject their ideology of murder. Their 
barbarism cannot be appeased, and their hatred cannot be satisfied. 
There's only one way to deal with terror: We must confront the enemy and 
stay on the offensive until these killers are defeated." -- George W. Bush




  parent reply	other threads:[~2004-05-25 21:50 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-22 10:19 copy constructor for sockets Andrew Carroll
2004-05-22 11:55 ` Simon Wright
2004-05-22 18:39   ` tmoran
2004-05-23 21:04   ` Matthew Heaney
2004-05-24  7:13     ` Marius Amado Alves
2004-05-24  3:23       ` Matthew Heaney
2004-05-24  4:53         ` Simon Wright
2004-05-24  5:20           ` tmoran
2004-05-25  4:53             ` Simon Wright
2004-05-24 12:36           ` Matthew Heaney
2004-05-25 21:50           ` Robert I. Eachus [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-05-22 21:18 Andrew Carroll
2004-05-22 21:46 ` tmoran
2004-05-23 11:21   ` Simon Wright
2004-05-24 18:26     ` tmoran
2004-05-25  5:10       ` Simon Wright
2004-05-25  6:37         ` tmoran
2004-05-23  9:43 ` Mark Lorenzen
2004-05-23 11:27 ` Simon Wright
2004-05-24 11:28 Andrew Carroll
2004-05-25  5:29 ` Simon Wright
replies disabled

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