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

[whatwg] localStorage mutex - a solution?

From: Adam Barth <whatwg@adambarth.com>
Date: Sun, 8 Nov 2009 16:42:00 -0800
Message-ID: <7789133a0911081642l18ba153eie57456a3ca180f64@mail.gmail.com>
On Sat, Nov 7, 2009 at 12:08 AM, Chris Jones <cjones at mozilla.com> wrote:
> Rob Ennals wrote:
>>
>> Missed out the important final qualifier. Here's take 3:
>>
>> "the user agent MUST NOT release the storage mutex between calls to local
>> storage, except that the user agent MAY release the storage mutex on any API
>> operation /other that a local storage oeration/"
>
> IMHO, this is actually worse than the current proposal of a global mutex :S.
> ?This proposal makes atomicity guarantees not only library-dependent, but
> browser-implementation-dependent. ?For example
>
> ?a = localStorage.x()
> ?jquery.foo()
> ?b = localStorage.y()

As I mentioned to Ian at TPAC, one way to make this more predictable
is to release the lock on *every* function call and return.  This
provides content enough atomicity to build whatever locks it needs.

Adam
Received on Sunday, 8 November 2009 16:42:00 UTC

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