Re: LocalStorage inside Worker

>
>
> Ok. But what i'm trying to say is, forcing the localStorage to use
> "atomic" block is a bad idea in the main page thread since a
> transaction in the main page thread can span very long time perhaps
> committed by a click event.


How is this any different from having a big loop an any callback:

var onclick = fuction() {
   for (i = 0; i < 1000000000; i++) {
       // do some work
   }
}

I've just made the page non-responsive...

Also notice:

atomic(function(state) {...})

The commit happens automatically when the callback function returns, so a
split transaction (the commit in a callback) is impossible with this
formulation. Just think about the lexical-scoping.


Cheers,
Keean.

Received on Friday, 7 January 2011 10:39:41 UTC