Weak Reference proposal

Isiah Meadows isiahmeadows at gmail.com
Sat Dec 31 17:19:32 UTC 2016


That is a concern largely independent of my need for weak references
(despite the relation). I can still implement a basic tiered
mark-and-sweep without weak references, given I can already destroy
things manually with just the ID. All I want is a way to implicitly
call that destructor within the individual process.

-----

Isiah Meadows
me at isiahmeadows.com


On Sat, Dec 31, 2016 at 9:23 AM, Alexander Jones <alex at weej.com> wrote:
> Please correct me Isiah/Steve - but I think the problem Steve is talking
> about is *cross-process* cycles. Without an inter-process protocol to
> express the referencing graph, or otherwise negotiate cycles for GC, you'll
> never have a way to reclaim them. Each side thinks the other side is still
> needing the resource.
>
> Cheers
>
> On 31 December 2016 at 13:48, Isiah Meadows <isiahmeadows at gmail.com> wrote:
>>
>> For my particular case, yes it is. Everything mirrored have globally
>> unique IDs assigned to them, managed independently of the child
>> process (in most cases), and the state is tied to the ID, not the
>> value, so I only need a weak reference to clear the backing ID and its
>> associated state. And reference cycles within the process are
>> mitigated by the existing mark-and-sweep derivatives engines already
>> use.
>> -----
>>
>> Isiah Meadows
>> me at isiahmeadows.com
>>
>>
>> On Tue, Dec 27, 2016 at 4:34 PM, Steve Fink <sphink at gmail.com> wrote:
>> > On 12/27/2016 04:45 AM, Isiah Meadows wrote:
>> >
>> > The weak reference proposal hasn't seen a lot of activity, and I haven't
>> > found much news elsewhere on it. What's the status on it?
>> >
>> > Where I'm building a language-integrated process pool in Node.js,
>> > complete
>> > with shared "references" and async iterator support, I really badly need
>> > weak references to avoid otherwise inevitable memory leaks across
>> > multiple
>> > processes if the references aren't explicitly released. So far, my only
>> > option is to take a native dependency (I have no other dependencies),
>> > but
>> > that's very suboptimal, and it eliminates the possibility of porting to
>> > browsers. So I really badly need language-level weak references.
>> >
>> >
>> > Would weak references be enough to solve cross-process garbage
>> > collection?
>> > How would you recover a cycle of references among your processes?
>> >
>> >
>> > _______________________________________________
>> > es-discuss mailing list
>> > es-discuss at mozilla.org
>> > https://mail.mozilla.org/listinfo/es-discuss
>> >
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>
>


More information about the es-discuss mailing list