On Fri, Apr 3, 2009 at 2:49 PM, Robert O'Callahan <rob...@ocallahan.org>wrote:
> On Sat, Apr 4, 2009 at 6:35 AM, Jeremy Orlow <jor...@google.com> wrote: > >> People are now talking about specifying this, but there's been push back. >> Also, there's no way to guarantee serializability for the network traffic >> portion so I'm guessing (hoping!) that this wouldn't be required in the >> JavaScript side, even if it went through. > > > What exactly do you mean by that? It's easy to guarantee that reading the > cookies to send with an HTTP request is an atomic operation, and writing > them as a result of an HTTP response is an atomic operation. > True serializability would imply that the HTTP request read and write are atomic. In other words, you'd have to keep a lock for the entirety of each HTTP request and couldn't do multiple in parallel. When I said there's no way to guarantee serializability, I guess I meant to qualify it with "in practice". After thinking about it for a bit, your suggestion of "reading the cookies to send with an HTTP request is an atomic operation, and writing them as a result of an HTTP response is an atomic operation" does seems like a pretty sensible compromise. The one thing I'd still be concerned about: localStorage separates storage space by origins. In other words, www.google.com cannot access localStorage values from google.com and visa versa. Cookies, on the other hand, have a much more complex scheme of access control. Coming up with an efficient and dead-lock-proof locking scheme might take some careful thought. > The spec is written in such a way that you can't have more that one event >> loop per browser window/worker, and everything is essentially tied to this >> one event loop. In other words, each window/worker can't run on more than >> one CPU core at a time. Thus, the only way for a web application to scale >> in todays world is going to be through additional windows and/or workers. >> > > Depending on exactly what you mean by a "Web application", that's not > really true. There are a variety of ways to exploit multicore parallelism > within a window with the current set of specs, at least in principle. What else is there? (I believe you, I'm just interested in knowing what's out there.) Jeremy P.S. Please don't mistake me for an expert on document.cookie or even window.localStorage. I try to fact check myself as I go, but if I say something that seems stupid, please do let me know. :-)