[whatwg] Application defined "locks"

Robert O'Callahan robert at ocallahan.org
Thu Sep 10 16:55:41 PDT 2009


On Thu, Sep 10, 2009 at 10:46 AM, Darin Fisher <darin at chromium.org> wrote:

> On Wed, Sep 9, 2009 at 3:37 PM, Maciej Stachowiak <mjs at apple.com> wrote:
>
>> I'm really hesitant to expose explicit locking to the Web platform.
>> Mutexes are incredibly hard to program with correctly, and we will surely
>> end up with stuck locks, race conditions, livelocks, and so forth. For
>> Workers I was happy that we managed to avoid any locking primitives by using
>> a message-passing model, but explicit mutexes would ruin that.
>>
>>
>
> Note: I probably made a mistake calling these locks since they do not work
> like normal mutexes.  You can only wait for one of these locks
> asynchronously.  There is no synchronous blocking, which avoids most of the
> problems you mention.
>

I don't think it does. It makes deadlock less bad, because the application
can still respond to events. But there will still be deadlocks in the sense
that cyclic waits-for graphs will permanently stop the application from
making progress. It won't help at all with livelocks or race conditions.

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090911/6479b3be/attachment-0002.htm>


More information about the whatwg mailing list