Re: DOD etc

2002-08-27 Thread Steve Fink
On Tue, Aug 27, 2002 at 01:23:50PM -0700, Sean O'Rourke wrote: > On Tue, 27 Aug 2002, Mike Lambert wrote: > > Is there still a need for determinstic destruction, even in light of the > > alternative approaches mentioned above? > > Yes, if the destruction of the resource is itself important to the

Re: DOD etc

2002-08-27 Thread Sean O'Rourke
On Tue, 27 Aug 2002, Mike Lambert wrote: > Is there still a need for determinstic destruction, even in light of the > alternative approaches mentioned above? Yes, if the destruction of the resource is itself important to the program. For example, one way to do exception-safe locks in C++ is to h

Re: DOD etc

2002-08-27 Thread Mike Lambert
Let me ask a somewhat obvious question here. Why is deterministic destruction needed? The most often-used example is that of objects with external resources like filehandles or network sockets. Let me take that argument for the duration of this email, but please feel free to bring up other reaso

Re: DOD etc

2002-08-27 Thread Juergen Boemmels
"Sean O'Rourke" <[EMAIL PROTECTED]> writes: > On Mon, 26 Aug 2002, Nicholas Clark wrote: > > All ways of doing deterministic destruction seem to have considerable > > overhead. > > One possible alternative would be to have file handles and other objects > with destructors that have to be called

Re: DOD etc

2002-08-26 Thread Sean O'Rourke
On Mon, 26 Aug 2002, Nicholas Clark wrote: > All ways of doing deterministic destruction seem to have considerable > overhead. One possible alternative would be to have file handles and other objects with destructors that have to be called in a timely fashion keep ref-counts. When the refcount d

Re: DOD etc

2002-08-26 Thread Nicholas Clark
How does this work? 1 my $fh = IO::File->new(...); # Compiler can know that the new object is still linked. 2 &some_sub ($fh); # Who knows? :-) # Compiler will assume that new object is still linked. 3 undef $fh; # Er? Need a DOD run right now, because that may have been the las

Re: DOD etc

2002-08-25 Thread Tanton Gibbs
> > my $fh = IO::File->new(...) > > > >anywhere in the program or its libraries would trigger this slow behaviour > >for the rest of the program. > > No. That's why we make it a counter. When a DOD run is made we recalc > the number of deterministci destructions needed. But, more than likely,

Re: DOD etc

2002-08-25 Thread Nicholas Clark
On Sun, Aug 25, 2002 at 01:34:32PM -0400, Dan Sugalski wrote: > At 4:22 PM +0100 8/25/02, Dave Mitchell wrote: > >Well, if understood you correctly, then a single execution of > > > >my $fh = IO::File->new(...) > > > >anywhere in the program or its libraries would trigger this slow behaviour

Re: DOD etc

2002-08-25 Thread Dan Sugalski
At 4:22 PM +0100 8/25/02, Dave Mitchell wrote: >On Sun, Aug 25, 2002 at 11:16:35AM -0400, Tanton Gibbs wrote: >> > In this case, it is quite likely that many programs will get that flag >> > set. In which case, we'll need to be doing a DOD run at the end of most >> > blocks >> >> I would hope

Re: DOD etc

2002-08-25 Thread Nicholas Clark
On Sun, Aug 25, 2002 at 04:22:33PM +0100, Dave Mitchell wrote: > Well, if understood you correctly, then a single execution of > > my $fh = IO::File->new(...) > > anywhere in the program or its libraries would trigger this slow behaviour > for the rest of the program. I'd have thought that t

Re: DOD etc

2002-08-25 Thread Dave Mitchell
On Sun, Aug 25, 2002 at 11:16:35AM -0400, Tanton Gibbs wrote: > > In this case, it is quite likely that many programs will get that flag > > set. In which case, we'll need to be doing a DOD run at the end of most > > blocks > > I would hope not. The only things which will set this flag are those

Re: DOD etc

2002-08-25 Thread Tanton Gibbs
> In this case, it is quite likely that many programs will get that flag > set. In which case, we'll need to be doing a DOD run at the end of most > blocks I would hope not. The only things which will set this flag are those items needing deterministic destruction, not all items with a destruct

Re: DOD etc

2002-08-25 Thread Dave Mitchell
On Sun, Aug 25, 2002 at 12:13:36AM -0400, Tanton Gibbs wrote: > > In my understanding, no. One possible implementation is to set a flag when > > we create an active_destruction PMC (like IO::File), and perform dod runs > > at every block close until we don't have any such PMCs left. > > I earlier

Re: DOD etc

2002-08-21 Thread Mike Lambert
> In this Brave New World of DOD and GCC, what guarantees (if any) > will we be making at the Perl 6 language level for the timely calling of > object destructors at scope exit? >From the straight GC perspective, none. There might be workarounds at higher-levels, however. > ie the classic > >

Re: DOD etc

2002-08-21 Thread Dave Mitchell
On Wed, Aug 21, 2002 at 08:25:10PM +0100, I wrote: > In this Brave New World of DOD and GCC, what guarantees (if any) s/GCC/GC/ What with PMC, PDD, COW etc, I have TLA on the brain. :-) -- Nothing ventured, nothing lost.

DOD etc

2002-08-21 Thread Dave Mitchell
In this Brave New World of DOD and GCC, what guarantees (if any) will we be making at the Perl 6 language level for the timely calling of object destructors at scope exit? ie the classic { my $fh = IO::File->new(...); } I know there's been lots of discussion on this over the months, bu