On 8 January 2011 00:57, Glenn Maynard <gl...@zewt.org> wrote: > >> On Thu, Jan 6, 2011 at 6:06 PM, Charles Pritchard<ch...@jumis.com> > wrote: > >>> I don't think localStorage should be (to web workers), but > sessionStorage > >>> seems > >>> a reasonable request. > > > It's not arbitrary: the names "local" and "session" convey some meaning. > > localStorage works well enough, out in the wild. sessionStorage is not in > > wide use. > > > > I don't think it's restrictive, it just creates a wider implementation > > divide between session and local. > > What I meant was: you said that you don't think localStorage should be > available to workers, but I don't understand why. Why should > sessionStorage be available, but localStorage not? > > -- > Glenn Maynard > > There is also the issue that current localStorage implementations may be broken by multiple tabs/windows. To say it works well enough in the wild seems to ignore this brokenness.
If access had to be from inside an "atomic" block (a callback from a single storage-thread) then this would fix access from multiple tabs/windows as well as from worker threads. This could be implemented as a single threaded callback serialising access to the storage, but implementers could choose to use Software Transactional Memory techniques to give their browser a speed advantage. Cheers, Keean.