Re: [whatwg] Application defined locks

2009-09-11 Thread Jeremy Orlow
On Fri, Sep 11, 2009 at 11:52 AM, Darin Fisher da...@chromium.org wrote: Also, the other motivating factor for me is access to LocalStorage from workers. (I know it has been removed from the spec, but that is unfortunate, no?) This was only done because the storage mutex was added in. Now

Re: [whatwg] Application defined locks

2009-09-11 Thread Mike Shaver
Aaron, You're right, my recollection is quite incorrect. My apologies for unfairly describing the origin of the proposal. Do you agree with Jeremy that Database is too far along in terms of deployment to have significant changes made to it? Given that we're still hashing our major

Re: [whatwg] Application defined locks

2009-09-11 Thread Aaron Boodman
On Fri, Sep 11, 2009 at 9:03 AM, Mike Shaver mike.sha...@gmail.com wrote: Aaron, You're right, my recollection is quite incorrect.  My apologies for unfairly describing the origin of the proposal. I forgive you :). In fact, the many design changes to the database API were made precisely

Re: [whatwg] Application defined locks

2009-09-11 Thread Michael Nordman
On Thu, Sep 10, 2009 at 6:35 PM, James Robinson jam...@google.com wrote: On Thu, Sep 10, 2009 at 6:11 PM, Jeremy Orlow jor...@chromium.org wrote: On Fri, Sep 11, 2009 at 9:28 AM, Darin Fisher da...@chromium.org wrote: On Thu, Sep 10, 2009 at 4:59 PM, Robert O'Callahan rob...@ocallahan.org

Re: [whatwg] Application defined locks

2009-09-11 Thread Jeremy Orlow
On Sat, Sep 12, 2009 at 1:20 AM, Aaron Boodman a...@google.com wrote: On Fri, Sep 11, 2009 at 9:03 AM, Mike Shaver mike.sha...@gmail.com wrote: Aaron, You're right, my recollection is quite incorrect. My apologies for unfairly describing the origin of the proposal. I forgive you :).

Re: [whatwg] Application defined locks

2009-09-10 Thread Maciej Stachowiak
On Sep 9, 2009, at 10:12 PM, Aaron Boodman wrote: OTOH, it seems like showModalDialog() is just a sharp edge that is likely to hurt you no matter what. Even with your proposal, unless you carefully arranged things in preparation for showModalDialog(), you could get stuck the same way.

Re: [whatwg] Application defined locks

2009-09-10 Thread Michael Nordman
On Wed, Sep 9, 2009 at 7:55 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Sep 10, 2009 at 2:38 PM, Michael Nordman micha...@google.comwrote: If this feature existed, we likely would have used it for offline Gmail to coordinate which instance of the app (page with gmail in it)

Re: [whatwg] Application defined locks

2009-09-10 Thread Maciej Stachowiak
On Sep 10, 2009, at 11:22 AM, Michael Nordman wrote: On Wed, Sep 9, 2009 at 7:55 PM, Robert O'Callahan rob...@ocallahan.org wrote: On Thu, Sep 10, 2009 at 2:38 PM, Michael Nordman micha...@google.com wrote: If this feature existed, we likely would have used it for offline Gmail to

Re: [whatwg] Application defined locks

2009-09-10 Thread Darin Fisher
On Thu, Sep 10, 2009 at 12:32 PM, Maciej Stachowiak m...@apple.com wrote: On Sep 10, 2009, at 11:22 AM, Michael Nordman wrote: On Wed, Sep 9, 2009 at 7:55 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Sep 10, 2009 at 2:38 PM, Michael Nordman micha...@google.comwrote: If this

Re: [whatwg] Application defined locks

2009-09-10 Thread Oliver Hunt
On Sep 10, 2009, at 12:55 PM, Darin Fisher wrote: On Thu, Sep 10, 2009 at 12:32 PM, Maciej Stachowiak m...@apple.com wrote: On Sep 10, 2009, at 11:22 AM, Michael Nordman wrote: On Wed, Sep 9, 2009 at 7:55 PM, Robert O'Callahan rob...@ocallahan.org wrote: On Thu, Sep 10, 2009 at 2:38

Re: [whatwg] Application defined locks

2009-09-10 Thread Darin Fisher
On Thu, Sep 10, 2009 at 1:08 PM, Oliver Hunt oli...@apple.com wrote: On Sep 10, 2009, at 12:55 PM, Darin Fisher wrote: On Thu, Sep 10, 2009 at 12:32 PM, Maciej Stachowiak m...@apple.com wrote: On Sep 10, 2009, at 11:22 AM, Michael Nordman wrote: On Wed, Sep 9, 2009 at 7:55 PM, Robert

Re: [whatwg] Application defined locks

2009-09-10 Thread Michael Nordman
On Thu, Sep 10, 2009 at 12:32 PM, Maciej Stachowiak m...@apple.com wrote: On Sep 10, 2009, at 11:22 AM, Michael Nordman wrote: On Wed, Sep 9, 2009 at 7:55 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Sep 10, 2009 at 2:38 PM, Michael Nordman micha...@google.comwrote: If this

Re: [whatwg] Application defined locks

2009-09-10 Thread James Robinson
On Thu, Sep 10, 2009 at 1:55 PM, Darin Fisher da...@chromium.org wrote: On Thu, Sep 10, 2009 at 1:08 PM, Oliver Hunt oli...@apple.com wrote: On Sep 10, 2009, at 12:55 PM, Darin Fisher wrote: On Thu, Sep 10, 2009 at 12:32 PM, Maciej Stachowiak m...@apple.comwrote: On Sep 10, 2009, at

Re: [whatwg] Application defined locks

2009-09-10 Thread Darin Fisher
On Thu, Sep 10, 2009 at 2:38 PM, James Robinson jam...@google.com wrote: On Thu, Sep 10, 2009 at 1:55 PM, Darin Fisher da...@chromium.org wrote: On Thu, Sep 10, 2009 at 1:08 PM, Oliver Hunt oli...@apple.com wrote: On Sep 10, 2009, at 12:55 PM, Darin Fisher wrote: On Thu, Sep 10, 2009 at

Re: [whatwg] Application defined locks

2009-09-10 Thread Michael Nordman
On Thu, Sep 10, 2009 at 2:38 PM, James Robinson jam...@google.com wrote: On Thu, Sep 10, 2009 at 1:55 PM, Darin Fisher da...@chromium.org wrote: On Thu, Sep 10, 2009 at 1:08 PM, Oliver Hunt oli...@apple.com wrote: On Sep 10, 2009, at 12:55 PM, Darin Fisher wrote: On Thu, Sep 10, 2009 at

Re: [whatwg] Application defined locks

2009-09-10 Thread Scott Hess
On Thu, Sep 10, 2009 at 2:38 PM, James Robinsonjam...@google.com wrote: I also strongly feel that giving web developers access to locking mechanisms is a bad idea - it hasn't been a spectacular success in any other language. I think that you can either give web developers a strong set of

Re: [whatwg] Application defined locks

2009-09-10 Thread Robert O'Callahan
On Thu, Sep 10, 2009 at 10:46 AM, Darin Fisher da...@chromium.org wrote: On Wed, Sep 9, 2009 at 3:37 PM, Maciej Stachowiak m...@apple.com wrote: I'm really hesitant to expose explicit locking to the Web platform. Mutexes are incredibly hard to program with correctly, and we will surely end

Re: [whatwg] Application defined locks

2009-09-10 Thread Darin Fisher
On Thu, Sep 10, 2009 at 4:59 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Fri, Sep 11, 2009 at 9:52 AM, Darin Fisher da...@chromium.org wrote: I think there are good applications for setting a long-lived lock. We can try to make it hard for people to create those locks, but then the

Re: [whatwg] Application defined locks

2009-09-10 Thread Jeremy Orlow
On Fri, Sep 11, 2009 at 9:28 AM, Darin Fisher da...@chromium.org wrote: On Thu, Sep 10, 2009 at 4:59 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Fri, Sep 11, 2009 at 9:52 AM, Darin Fisher da...@chromium.org wrote: I think there are good applications for setting a long-lived lock.

Re: [whatwg] Application defined locks

2009-09-10 Thread James Robinson
On Thu, Sep 10, 2009 at 6:11 PM, Jeremy Orlow jor...@chromium.org wrote: On Fri, Sep 11, 2009 at 9:28 AM, Darin Fisher da...@chromium.org wrote: On Thu, Sep 10, 2009 at 4:59 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Fri, Sep 11, 2009 at 9:52 AM, Darin Fisher

Re: [whatwg] Application defined locks

2009-09-10 Thread Darin Fisher
On Thu, Sep 10, 2009 at 5:28 PM, Darin Fisher da...@chromium.org wrote: On Thu, Sep 10, 2009 at 4:59 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Fri, Sep 11, 2009 at 9:52 AM, Darin Fisher da...@chromium.org wrote: I think there are good applications for setting a long-lived lock.

Re: [whatwg] Application defined locks

2009-09-10 Thread James Robinson
On Thu, Sep 10, 2009 at 7:59 PM, Darin Fisher da...@chromium.org wrote: rt oOn Thu, Sep 10, 2009 at 6:35 PM, James Robinson jam...@google.comwrote: On Thu, Sep 10, 2009 at 6:11 PM, Jeremy Orlow jor...@chromium.orgwrote: On Fri, Sep 11, 2009 at 9:28 AM, Darin Fisher da...@chromium.orgwrote:

Re: [whatwg] Application defined locks

2009-09-09 Thread Michael Nordman
+1, a nice refactoring of the implied locking gunk in the storage api. On Wed, Sep 9, 2009 at 10:55 AM, Darin Fisher da...@chromium.org wrote: The recent discussion about the storage mutex for Cookies and LocalStorage got me thinking Perhaps instead of trying to build implicit locking

Re: [whatwg] Application defined locks

2009-09-09 Thread Aaron Boodman
On Wed, Sep 9, 2009 at 10:55 AM, Darin Fisherda...@chromium.org wrote: I imagine a simple lock API: window.acquireLock(name) window.releaseLock(name) I do not think it is a good idea to allow long-lived (past a stack frame) locks on the types of things we've been discussing (local storage,

Re: [whatwg] Application defined locks

2009-09-09 Thread Darin Fisher
On Wed, Sep 9, 2009 at 11:08 AM, Aaron Boodman a...@google.com wrote: On Wed, Sep 9, 2009 at 10:55 AM, Darin Fisherda...@chromium.org wrote: I imagine a simple lock API: window.acquireLock(name) window.releaseLock(name) I do not think it is a good idea to allow long-lived (past a stack

Re: [whatwg] Application defined locks

2009-09-09 Thread Aaron Boodman
On Wed, Sep 9, 2009 at 11:23 AM, Darin Fisherda...@chromium.org wrote: On Wed, Sep 9, 2009 at 11:08 AM, Aaron Boodman a...@google.com wrote: There would presumably have to be a separate name value for each API, though, right? So we're talking about the difference between:

Re: [whatwg] Application defined locks

2009-09-09 Thread Darin Fisher
On Wed, Sep 9, 2009 at 11:30 AM, Aaron Boodman a...@google.com wrote: On Wed, Sep 9, 2009 at 11:23 AM, Darin Fisherda...@chromium.org wrote: On Wed, Sep 9, 2009 at 11:08 AM, Aaron Boodman a...@google.com wrote: There would presumably have to be a separate name value for each API, though,

Re: [whatwg] Application defined locks

2009-09-09 Thread Maciej Stachowiak
On Sep 9, 2009, at 10:55 AM, Darin Fisher wrote: The recent discussion about the storage mutex for Cookies and LocalStorage got me thinking Perhaps instead of trying to build implicit locking into those features, we should give web apps the tools to manage exclusive access to shared

Re: [whatwg] Application defined locks

2009-09-09 Thread Darin Fisher
On Wed, Sep 9, 2009 at 3:37 PM, Maciej Stachowiak m...@apple.com wrote: On Sep 9, 2009, at 10:55 AM, Darin Fisher wrote: The recent discussion about the storage mutex for Cookies and LocalStorage got me thinking Perhaps instead of trying to build implicit locking into those features,

Re: [whatwg] Application defined locks

2009-09-09 Thread Robert O'Callahan
On Thu, Sep 10, 2009 at 6:37 AM, Darin Fisher da...@chromium.org wrote: Yes, exactly. Sorry for not making this clear. I believe implicit locking for LocalStorage (and the implicit unlocking) is going to yield something very confusing and hard to implement well. The potential for dead locks

Re: [whatwg] Application defined locks

2009-09-09 Thread Olli Pettay
On 9/10/09 2:24 AM, Robert O'Callahan wrote: On Thu, Sep 10, 2009 at 6:37 AM, Darin Fisher da...@chromium.org mailto:da...@chromium.org wrote: Yes, exactly. Sorry for not making this clear. I believe implicit locking for LocalStorage (and the implicit unlocking) is going to yield

Re: [whatwg] Application defined locks

2009-09-09 Thread Jeremy Orlow
In general this seems like a pretty interesting idea. It definitely would be nice to completely abstract away all concepts of concurrency from web developers, but some of our solutions thus far (message passing, async interfaces, etc) have not been terribly appreciated by developers either. The

Re: [whatwg] Application defined locks

2009-09-09 Thread Aaron Boodman
On Wed, Sep 9, 2009 at 11:30 AM, Aaron Boodmana...@google.com wrote: I see. So you are suggesting the localStorage could have zero concurrency guarantees and it is simply up to the developer to arrange things themselves using this new primitive. That is an interesting idea. You're right

Re: [whatwg] Application defined locks

2009-09-09 Thread Michael Nordman
If this feature existed, we likely would have used it for offline Gmail to coordinate which instance of the app (page with gmail in it) should be responsible for sync'ing the local database with the mail service. In the absence of a feature like this, instead we used the local database itself to

Re: [whatwg] Application defined locks

2009-09-09 Thread Robert O'Callahan
On Thu, Sep 10, 2009 at 1:33 PM, Jeremy Orlow jor...@chromium.org wrote: In general this seems like a pretty interesting idea. It definitely would be nice to completely abstract away all concepts of concurrency from web developers, but some of our solutions thus far (message passing, async

Re: [whatwg] Application defined locks

2009-09-09 Thread Robert O'Callahan
On Thu, Sep 10, 2009 at 2:38 PM, Michael Nordman micha...@google.comwrote: If this feature existed, we likely would have used it for offline Gmail to coordinate which instance of the app (page with gmail in it) should be responsible for sync'ing the local database with the mail service. In the

Re: [whatwg] Application defined locks

2009-09-09 Thread Darin Fisher
On Wed, Sep 9, 2009 at 4:24 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Sep 10, 2009 at 6:37 AM, Darin Fisher da...@chromium.org wrote: Yes, exactly. Sorry for not making this clear. I believe implicit locking for LocalStorage (and the implicit unlocking) is going to yield

Re: [whatwg] Application defined locks

2009-09-09 Thread Robert O'Callahan
On Thu, Sep 10, 2009 at 3:53 PM, Darin Fisher da...@chromium.org wrote: What concerns me are the cases where synchronous events (e.g., resizing an iframe) can cause script to execute in another domain. As spec'd, there is a potential dead lock with the storage mutex. We must carefully unlock

Re: [whatwg] Application defined locks

2009-09-09 Thread Darin Fisher
On Wed, Sep 9, 2009 at 9:07 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Sep 10, 2009 at 3:53 PM, Darin Fisher da...@chromium.org wrote: What concerns me are the cases where synchronous events (e.g., resizing an iframe) can cause script to execute in another domain. As spec'd,

Re: [whatwg] Application defined locks

2009-09-09 Thread Darin Fisher
On Wed, Sep 9, 2009 at 6:46 PM, Aaron Boodman a...@google.com wrote: On Wed, Sep 9, 2009 at 11:30 AM, Aaron Boodmana...@google.com wrote: I see. So you are suggesting the localStorage could have zero concurrency guarantees and it is simply up to the developer to arrange things

Re: [whatwg] Application defined locks

2009-09-09 Thread Jeremy Orlow
On Thu, Sep 10, 2009 at 1:13 PM, Darin Fisher da...@chromium.org wrote: On Wed, Sep 9, 2009 at 6:46 PM, Aaron Boodman a...@google.com wrote: On Wed, Sep 9, 2009 at 11:30 AM, Aaron Boodmana...@google.com wrote: I see. So you are suggesting the localStorage could have zero concurrency

Re: [whatwg] Application defined locks

2009-09-09 Thread Robert O'Callahan
On Thu, Sep 10, 2009 at 4:11 PM, Darin Fisher da...@chromium.org wrote: On Wed, Sep 9, 2009 at 9:07 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Sep 10, 2009 at 3:53 PM, Darin Fisher da...@chromium.org wrote: What concerns me are the cases where synchronous events (e.g., resizing

Re: [whatwg] Application defined locks

2009-09-09 Thread Darin Fisher
On Wed, Sep 9, 2009 at 9:27 PM, Jeremy Orlow jor...@chromium.org wrote: On Thu, Sep 10, 2009 at 1:13 PM, Darin Fisher da...@chromium.org wrote: On Wed, Sep 9, 2009 at 6:46 PM, Aaron Boodman a...@google.com wrote: On Wed, Sep 9, 2009 at 11:30 AM, Aaron Boodmana...@google.com wrote: I see.

Re: [whatwg] Application defined locks

2009-09-09 Thread Robert O'Callahan
On Thu, Sep 10, 2009 at 4:37 PM, Darin Fisher da...@chromium.org wrote: Imagine if you script a plugin inside the transaction, and before returning, the plugin scripts another window, I'm curious, how common is that anyway? Can we just tell plugins not to do that, and abort any plugin that

Re: [whatwg] Application defined locks

2009-09-09 Thread Jeremy Orlow
On Thu, Sep 10, 2009 at 1:37 PM, Darin Fisher da...@chromium.org wrote: On Wed, Sep 9, 2009 at 9:27 PM, Jeremy Orlow jor...@chromium.org wrote: On Thu, Sep 10, 2009 at 1:13 PM, Darin Fisher da...@chromium.org wrote: On Wed, Sep 9, 2009 at 6:46 PM, Aaron Boodman a...@google.com wrote: On

Re: [whatwg] Application defined locks

2009-09-09 Thread Darin Fisher
On Wed, Sep 9, 2009 at 9:28 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Sep 10, 2009 at 4:11 PM, Darin Fisher da...@chromium.org wrote: On Wed, Sep 9, 2009 at 9:07 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Sep 10, 2009 at 3:53 PM, Darin Fisher

Re: [whatwg] Application defined locks

2009-09-09 Thread Darin Fisher
On Wed, Sep 9, 2009 at 9:43 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Sep 10, 2009 at 4:37 PM, Darin Fisher da...@chromium.org wrote: Imagine if you script a plugin inside the transaction, and before returning, the plugin scripts another window, I'm curious, how common is

Re: [whatwg] Application defined locks

2009-09-09 Thread Aaron Boodman
On Wed, Sep 9, 2009 at 9:13 PM, Darin Fisherda...@chromium.org wrote: If I call showModalDialog from within a database transaction, and then showModalDialog tries to create another database transaction, should I expect that the transaction can be started within the nested run loop of the

Re: [whatwg] Application defined locks

2009-09-09 Thread Darin Fisher
On Wed, Sep 9, 2009 at 10:01 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Sep 10, 2009 at 4:57 PM, Darin Fisher da...@chromium.org wrote: On Wed, Sep 9, 2009 at 9:43 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Sep 10, 2009 at 4:37 PM, Darin Fisher

Re: [whatwg] Application defined locks

2009-09-09 Thread Darin Fisher
On Wed, Sep 9, 2009 at 10:03 PM, Aaron Boodman a...@google.com wrote: On Wed, Sep 9, 2009 at 9:13 PM, Darin Fisherda...@chromium.org wrote: If I call showModalDialog from within a database transaction, and then showModalDialog tries to create another database transaction, should I expect

Re: [whatwg] Application defined locks

2009-09-09 Thread Robert O'Callahan
On Thu, Sep 10, 2009 at 4:57 PM, Darin Fisher da...@chromium.org wrote: On Wed, Sep 9, 2009 at 9:43 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Sep 10, 2009 at 4:37 PM, Darin Fisher da...@chromium.org wrote: Imagine if you script a plugin inside the transaction, and before

Re: [whatwg] Application defined locks

2009-09-09 Thread Aaron Boodman
On Wed, Sep 9, 2009 at 10:07 PM, Darin Fisherda...@chromium.org wrote: Well, the problem is that the creator of the transaction and the code associated with the showModalDialog call may not be related.  The showModalDialog code might normally be used outside the context of a transaction, in