[whatwg] Combining the DedicatedWorker and SharedWorker interfaces
ap at webkit.org
Wed Nov 5 21:53:52 PST 2008
Nov 6, 2008, в 2:18 AM, Jonas Sicking написал(а):
>> Similarly, having separate interfaces for Worker and SharedWorker
>> implies that there is some fundamental difference in their behavior
>> - a difference that eludes me so far.
> A shared worker is shared between all scripts on a single site[*]
> that instantiates a worker with the same name. I.e. where the second
> argument to the constructor is the same. (Don't remember what
> happens if the second argument is the same as an existing worker,
> but the first is not, check with the spec).
Sure, that part is clear - but it's only about the behavior of the
object's constructor, not the object itself! It alone doesn't warrant
having a separate interface.
As an example from another area, see mmap(2) function - you can pass
MAP_ANON or MAP_FILE via its flags to achieve similar results. Note
also that it has a number of other options. If we create a separate
interface for every Worker isolation level needed (both inside and
outside), we'll soon end up with PrivateWorker, SharedDataWorker and
who knows what else.
- WBR, Alexey Proskuryakov
More information about the whatwg