[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How should we deal with weak refs to finalizable objects? (was: Re: [PA
From: |
felix . winkelmann |
Subject: |
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)) |
Date: |
Mon, 10 Jul 2023 11:13:40 +0200 |
> However, there's one more concern:
>
> > The potential use-after-free scenario can still happen if the object is
> > kept alive, regardless of how we handle weak refs, this is unavoidable
> > if we allow finalizers and keep the possibility of resurrection.
>
> I have thought about this a bit more but I came to the conclusion that
> from an abstraction point of view it's better to clear weak refs to
> finalized data. The reason is that when a module exposes an object, the
> *user* should not need to know or care exactly how that object is
> implemented and that it happens to use a finalizer.
>
I concur - it indeed breaks the abstraction. IHMO both behaviours (clearing
weak refs or not) have potential to confuse the user, but merely adding a
finalizer should not semantically change the behaviour of weak refs.
Let me think a bit more about this, please.
felix
- [PATCH] thread-safe handling of asynchronous events, felix . winkelmann, 2023/07/05
- Re: [PATCH] thread-safe handling of asynchronous events, Peter Bex, 2023/07/06
- Re: [PATCH] thread-safe handling of asynchronous events, felix . winkelmann, 2023/07/06
- Re: [PATCH] thread-safe handling of asynchronous events, Peter Bex, 2023/07/06
- Re: [PATCH] thread-safe handling of asynchronous events, felix . winkelmann, 2023/07/06
- [PATCH] Bugfix and drop weak references to finalizable objects (was: Re: [PATCH] thread-safe handling of asynchronous events), Peter Bex, 2023/07/07
- [PATCH] Bugfix and drop weak references to finalizable objects (was: Re: [PATCH] thread-safe handling of asynchronous events), felix . winkelmann, 2023/07/07
- [PATCH] Bugfix and drop weak references to finalizable objects (was: Re: [PATCH] thread-safe handling of asynchronous events), felix . winkelmann, 2023/07/07
- 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)), Peter Bex, 2023/07/10
- 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)),
felix . winkelmann <=
- 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)), felix . winkelmann, 2023/07/10
- 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)), Peter Bex, 2023/07/11
- 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)), Andy Bennett, 2023/07/26
- 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)), Peter Bex, 2023/07/27
- 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)), Peter Bex, 2023/07/27
- 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))_, felix . winkelmann, 2023/07/27
- [PATCH] Bugfix and drop weak references to finalizable objects (was: Re: [PATCH] thread-safe handling of asynchronous events), felix . winkelmann, 2023/07/11
Re: [PATCH] thread-safe handling of asynchronous events, felix . winkelmann, 2023/07/06
[PATCH] finalizer API (was: thread-safe handling of asynchronous events), felix . winkelmann, 2023/07/07