W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2008

[whatwg] workers

From: Aaron Boodman <aa@google.com>
Date: Tue, 30 Sep 2008 09:46:39 -0700
Message-ID: <278fd46c0809300946g19f4bd28r57a67a7a084cec64@mail.gmail.com>
2008/9/30 Alexey Proskuryakov <ap at webkit.org>:
> I'm not sure it's so good in the case of dedicated workers either, as they
> can be used from other contexts via additional message ports. The close()
> method could just close the default port.

Sure, but in order for that to have happened, whoever created the
worker in the first place must have done it on purpose. The original
worker instance is anonymous. If the creator of that worker decides to
share it, that's fine, but it's more like cooperative sharing.

close() was added so that you could forcibly kill a worker. For
example, if you are searching a large set with many workers, you may
want to kill them once one finds a match.

The same could be achieved by just setting all the ports to null and
waiting for GC, but:

a) GC might not be for awhile, which is wasteful
b) It is hard to track where all the ports went

So I think it is useful to have a conceptual difference between
workers that are 'dedicated' and those that are 'shared'.

- a
Received on Tuesday, 30 September 2008 09:46:39 UTC

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