Re: How should we deal with weak refs to finalizable objects? (was: Re: [PATCH] Bugfix and drop weak references to finalizable objects (was: Re: [PATCH] thread-safe handling of asynchronous events))

2023-07-27 Thread Peter Bex
On Thu, Jul 27, 2023 at 12:30:46PM +0200, Peter Bex wrote: > 1) There's no (efficient) way to know if an object is a finalizable one. >We need this because we can't simply clear *all* the objects inside >a finalizable object that aren't referenced elsewhere, because we do >want to keep

Re: How should we deal with weak refs to finalizable objects? (was: Re: [PATCH] Bugfix and drop weak references to finalizable objects (was: Re: [PATCH] thread-safe handling of asynchronous events))

2023-07-27 Thread Peter Bex
On Wed, Jul 26, 2023 at 04:45:53PM +0100, Andy Bennett wrote: > So how can we finalise a circular list of objects all of which have > finalisers and still maintain atomicity? > > The docs say the order is "undefined". > It seems that the best way to finalise this structure is to explicitly break >

Re: How should we deal with weak refs to finalizableobjects?_(was:_Re:__[PATCH]_Bugfix_and_drop_weak_references_to_finalizable_objects_(was:_Re:_[PATCH]_thread-safe_handling_of_asynchronous_events))_

2023-07-27 Thread felix . winkelmann
> I think here we're struggling with the atomicity of the garbage collector > because the finaliser is special user code that executes inside the garbage > collector's "transaction" and that code has all the power and capabilities > of any other scheme code. Finalizer code is in no way special,