W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2009

[whatwg] Worker lifecycle

From: Maciej Stachowiak <mjs@apple.com>
Date: Thu, 28 May 2009 03:34:52 -0700
Message-ID: <3FAB0481-3471-4C07-852E-DD68548002A6@apple.com>

On May 28, 2009, at 2:29 AM, Ian Hickson wrote:

> I just checked in a substantial change to the lifetime model for  
> workers.
> Instead of being bound to their ports, which became especially hard to
> implement for shared workers, they now just live as long as the  
> Document
> that created them (all of the Documents that obtained them, for shared
> workers), with this ownership inheriting to nested workers.
> I also removed the various ways to observe the lifetime,  
> namely .active
> and the 'close' events.
> I hope this will make the shared workers easier to implement. Please  
> let
> me know if this screws anything up for dedicated workers.

I'm assuming this is one of the changes:

> User agents must either act as if MessagePort objects have a strong  
> reference to their entangled MessagePort object or as if each  
> MessagePort object's owner has a strong reference to the MessagePort  
> object.

It seems to me the second alternative prevents MessagePorts created by  
a Window from ever being garbage collected until the user leaves the  
page. Is that a correct understanding? If so, that seems like it could  
create unbounded memory leaks in long-running Web applications that  
use MessagePorts, even if all references to both endpoints of the  
MessageChannel are dropped. That seems unacceptable to me, unless I  

Received on Thursday, 28 May 2009 03:34:52 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:12 UTC