I agree with Jeremy that the spec is currently unimplementable if we give localStorage access to workers. I&#39;d like to point out that &quot;workers who want to access localStorage just need to send a message to their main window&quot; breaks down for persistent workers (where you don&#39;t necessarily have an open browser window) and is pretty wonky for shared workers (you can send a message to a window, but that window may go away before your message is processed, so you end up having to build some kind of &quot;send message, timeout, pick a new window to send it to, etc&quot; message layer).<div>
<br></div><div>One alternative I&#39;d like to propose is to remove access to localStorage for dedicated workers, and give SharedWorkers access to localStorage, but have that storage be partitioned by the worker name (i.e. the worker can access it, but it&#39;s not shared with web pages or any other workers and so you don&#39;t have any synchronicity issues). I don&#39;t see how this would work for dedicated workers, though, since there&#39;s no name to partition storage access, but they could always fall back to postMessage().</div>
<div><br></div><div><div>-atw</div><div><br><div class="gmail_quote">On Fri, Mar 20, 2009 at 2:19 PM, Oliver Hunt <span dir="ltr">&lt;<a href="mailto:oliver@apple.com">oliver@apple.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 class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
When discussing this standard we have to recognize that not all<br>
browsers actually have a &quot;main thread&quot;. Time will tell if more or less<br>
browsers of the future will have multi-threaded architectures, but the<br>
trend has been for more I think.<br>
<br>
Any aspects of the spec that asserts or assumes a &quot;main thread&quot; is questionable.<br>
</blockquote>
<br></div>
Yes they do -- we&#39;re talking about the main thread from the point of view of javascript, which is not necessarily the UI thread.<br>
<br>
The important thing is that with the current model is that JS on any thread may be blocked by js executing in a worker, which leads to a page (in effect) locking up -- the UI may still be functional but that particular page will have hung.<br>
<font color="#888888">
<br>
--Oliver<br>
</font></blockquote></div><br></div></div>