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

[whatwg] localStorage + worker processes

From: Robert O'Callahan <robert@ocallahan.org>
Date: Tue, 24 Mar 2009 10:24:47 +1300
Message-ID: <11e306600903231424h3470b275y5e53752bfcf69297@mail.gmail.com>
On Tue, Mar 24, 2009 at 7:41 AM, Jeremy Orlow <jorlow at google.com> wrote:

> One thing that hasn't been considered yet is some sort of optional hint to
> say "I'm done" in terms of accessing localStorage.  Maybe call it
> localStorage.checkpoint() or localStroage.commit()?
>
> As far as the browser implemenation is concerned, a call to this function
> would be the same as the script ending.  The great thing about this is that
> if a developer found one problem location in their code, they could add
> it--but it'd be completely optional.
>

You mean if they find a performance problem due to overlarge lock scope?

That's not a terrible idea. It certainly makes far more sense to be safe by
default and add constructs and code to gain a bit more parallelism, than to
be unsafe and parallel by default and have to add constructs and code to get
safety.

I'm not sure what the semantics of a standalone "commit()" would be, though.
I think a better construct might be some sort of "yield" which explicitly
returns to a (nested) browser event loop and basically acts as a script
completion point. Even browsers that only use a single thread can run the
event loop there so that testing in those browsers will reveal bugs.

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/20090324/58a4eb28/attachment.htm>
Received on Monday, 23 March 2009 14:24:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:47:49 GMT