W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: Synchronous postMessage for Workers?

From: Charles Pritchard <chuck@jumis.com>
Date: Thu, 17 Nov 2011 18:47:29 -0800
Message-Id: <A7C63BF4-3262-4E13-8A6B-CB8477EED627@jumis.com>
Cc: David Levin <levin@chromium.org>, Joshua Bell <jsbell@chromium.org>, "public-webapps@w3.org" <public-webapps@w3.org>
To: Jonas Sicking <jonas@sicking.cc>

On Nov 17, 2011, at 6:41 PM, Jonas Sicking <jonas@sicking.cc> wrote:

> On Thu, Nov 17, 2011 at 6:05 PM, David Levin <levin@chromium.org> wrote:
>> On Thu, Nov 17, 2011 at 5:05 PM, Jonas Sicking <jonas@sicking.cc> wrote:
>>> On Thu, Nov 17, 2011 at 2:07 PM, David Levin <levin@chromium.org> wrote:
>>>> It seems like this mechanism would deadlock a worker if two workers send
>>>> each other a synchronous message.
>>> Indeed. We can only allow child workers to block on parent workers.
>>> Never the other way around.
>> So the api would have to know who is listening to the other end of the port
>> and throw if it isn't a parent?
> I'm not convinced that we can do this with ports in a sane manner.
> Only on dedicated workers. There you always know who is listening on
> the other end. I.e. only on the DedicatedWorkerGlobalScope/Worker
> interfaces.

I agree on this one. A big no-thanks to synchronous messaging over ports.

Still, dedicated workers to a parent seems doable.

I've proposed a different worker scope for lightweight threads. Dedicated workers are relatively heavy and so a few workers blocked on the parent is not outside of acceptability.

Received on Friday, 18 November 2011 02:48:01 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:36 UTC