<br><br><div class="gmail_quote">On Thu, Sep 3, 2009 at 1:32 PM, Benjamin Smedberg <span dir="ltr"><<a href="mailto:bsmedberg@mozilla.com">bsmedberg@mozilla.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 9/3/09 4:24 PM, Drew Wilson wrote:<br>
> I think the canonical racy case is "the page wants to keep a counter for<br>
> the number of times event X occurs" in a cookie or local storage.<br>
><br>
> It doesn't seem to be possible to achieve this without the mutex - the<br>
> proposal below would break down if two pages tried to increment the<br>
> cookie value simultaneously (if both pages changed "cookieValue=3" to<br>
> "cookieValue=4" at the same time, the result of your merge step would<br>
> likely be "cookieValue=4", not "cookieValue=5" as one might intend).<br>
<br>
</div>Is that case important? I think that it's more important to make sure that<br>
script doesn't inadvertently remove or modify cookies due to races in<br>
document.cookie, but that maintaining a single-threaded view of the cookie<br>
data is not desirable.<br></blockquote><div><br></div><div>You're asking the wrong guy - I'm in the "don't bother trying to ensure consistency" camp :) I'm just parroting the arguments that were offered previously.</div>
<div><br></div><div>If I hadn't lost the arguments about providing workers access to cookies, then I'd say that pages that care about cookie consistency should set cookies via a SharedWorker. But failing that, it seems like the choices are fairly stark: ensure consistency and take the performance hit in all multi-threaded browsers, or explicitly disavow consistency, and console ourselves by making our future APIs more multi-process friendly.</div>
<div><br></div><div>I do understand the point of view of the "correctness over performance" camp - however, as Jeremy points out, it doesn't sound like those arguments have gotten much traction with actual implementors yet.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
--BDS<br>
</blockquote></div><br>