[Bug 16025] Re: Web Storage Editor's Draft 28 November 2011 "The use of the storage mutex to avoid race conditions is currently considered by certain implementors to be too high a performance burden, to the point where allowing data corruption is considered preferabl

https://www.w3.org/Bugs/Public/show_bug.cgi?id=16025

--- Comment #1 from Ian 'Hixie' Hickson <ian@hixie.ch> 2012-07-10 21:26:48 UTC ---
How would you limit the number of writers to one process, given that there
could be two windows open on the same page (and thus reading and writing to the
same database) but using different processes?

If you mean that the writes should be queued to a single back-end writer, how
do you prevent corruption in a case such as the following? What should the
values read be where I have the question marks? Assume the two columns are
happening in different processes but exactly at the same time, though they can
be reading and writing via a single backend process if that helps.

   Window 1                      Window 2

   read key "test" (value=0)     read key "test" (value=0)

   write value=1 to key "test"   write value=1 to key "test"
   write value=a to key "v1"     write value=b to key "v1"
   write value=x to key "ra"     write value=y to key "rb"

   read key "test" (value=1?)    read key "test" (value=1?)
   read key "v1" (value=?)       read key "v1" (value=?)
   read key "ra" (value=?)       read key "ra" (value=?)
   read key "rb" (value=?)       read key "rb" (value=?)

   spin the event loop           spin the event loop

   read key "test" (value=1?)    read key "test" (value=1?)
   read key "v1" (value=?)       read key "v1" (value=?)
   read key "ra" (value=?)       read key "ra" (value=?)
   read key "rb" (value=?)       read key "rb" (value=?)

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 10 July 2012 21:26:51 UTC