Re: [sqlite] lock counting?

2007-11-01 Thread Richard Klein
Dan Kennedy wrote: From SQLite's point of view, locks are on a per file-handle basis. If a unix process that uses sqlite has two file-handles open on the same file (i.e. because the user has opened two separate connections with two calls to sqlite3_open()), SQLite expects them to be able to

Re: [sqlite] lock counting?

2007-11-01 Thread Richard Klein
Joe Wilson wrote: --- Richard Klein <[EMAIL PROTECTED]> wrote: In implementing xLock in a VFS, do we need to worry about lock counts, i.e. nested locking? In other words, if a process asks for, say, a SHARED lock, and he already has one, should we increment a SHARED lock count? Or is it okay

Re: [sqlite] lock counting?

2007-11-01 Thread Richard Klein
Dan Kennedy wrote: On 11/1/07, Richard Klein <[EMAIL PROTECTED]> wrote: In implementing xLock in a VFS, do we need to worry about lock counts, i.e. nested locking? No. You don't need to worry about that. In other words, if a process asks for, say, a SHARED lock, and he already has one,

Re: [sqlite] lock counting?

2007-11-01 Thread Dan Kennedy
On Wed, 2007-10-31 at 22:27 -0700, Joe Wilson wrote: > After reading Dan's response, I must be mis-interpreting these comments. I was a bit terse. See below. > > > > See comments for unixLock() and unixUnlock() in os_unix.c. > > > > /* > > ** An instance of the following structure is allocated

Re: [sqlite] lock counting?

2007-10-31 Thread Joe Wilson
After reading Dan's response, I must be mis-interpreting these comments. Please ignore. --- Joe Wilson <[EMAIL PROTECTED]> wrote: > --- Richard Klein <[EMAIL PROTECTED]> wrote: > > In implementing xLock in a VFS, do we need to worry > > about lock counts, i.e. nested locking? > > > > In other

Re: [sqlite] lock counting?

2007-10-31 Thread Joe Wilson
--- Richard Klein <[EMAIL PROTECTED]> wrote: > In implementing xLock in a VFS, do we need to worry > about lock counts, i.e. nested locking? > > In other words, if a process asks for, say, a SHARED > lock, and he already has one, should we increment a > SHARED lock count? Or is it okay to just

Re: [sqlite] lock counting?

2007-10-31 Thread Dan Kennedy
On 11/1/07, Richard Klein <[EMAIL PROTECTED]> wrote: > In implementing xLock in a VFS, do we need to worry > about lock counts, i.e. nested locking? No. You don't need to worry about that. > In other words, if a process asks for, say, a SHARED > lock, and he already has one, should we increment

[sqlite] lock counting?

2007-10-31 Thread Richard Klein
In implementing xLock in a VFS, do we need to worry about lock counts, i.e. nested locking? In other words, if a process asks for, say, a SHARED lock, and he already has one, should we increment a SHARED lock count? Or is it okay to just return, i.e. to treat the request as a no-op? Thanks, -