[whatwg] localStorage mutex - a solution?

Adam Barth whatwg at adambarth.com
Sun Nov 8 16:42:00 PST 2009


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



More information about the whatwg mailing list