<div class="gmail_quote">One thing that hasn&#39;t been considered yet is some sort of optional hint to say &quot;I&#39;m done&quot; in terms of accessing localStorage.  Maybe call it localStorage.checkpoint() or localStroage.commit()?</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">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&#39;d be completely optional.</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">This could be used in conjunction with most of the other ideas already floating around.</div><div class="gmail_quote"><br></div><div class="gmail_quote">J</div><div class="gmail_quote">
<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">On Sun, Mar 22, 2009 at 4:24 PM, Drew Wilson <span dir="ltr">&lt;<a href="mailto:atwilson@google.com">atwilson@google.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>If you deny workers, you can enforce exclusive access to localStorage by applying a lock that extends from the first access of localStorage until the script re-enters the event loop. Page script is guaranteed to re-enter the event loop fairly quickly (lest it trigger the browser&#39;s &quot;this script is taking too long to run&quot; protection) so you won&#39;t get starvation. Since worker script never has to re-enter the event loop, this isn&#39;t a feasible solution for workers.</div>

<div><br></div><div>That&#39;s why I&#39;m proposing that the most reasonable implementation is just to have a simple lock like I describe above, and then either deny access to localStorage to dedicated workers (shared workers can silo the storage as I described previously), or else just enforce a limit to how long workers can hold the localStorage lock (if they hold it beyond some period, they get terminated just like page script that doesn&#39;t re-enter the event loop).</div>

<div><br></div><div>-atw<div class="im"><br><br><div class="gmail_quote">On Sun, Mar 22, 2009 at 12:07 PM, Michael Nordman <span dir="ltr">&lt;<a href="mailto:michaeln@google.com" target="_blank">michaeln@google.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><div class="gmail_quote"><div><div><div>I don&#39;t see how denying workers solves the problem. In a multi-threaded browser, this has to be resolved reasonably even in the absence of workers. </div></div></div></div>

</blockquote></div></div></div></blockquote></div><br>