Re: [sqlite] Sharing an SQLite database (using whole-file locking) over OpenAFS (Andrew File System)

2010-04-12 Thread Simon Slavin

On 13 Apr 2010, at 5:19am, Max Vlasov wrote:

> On Tue, Apr 13, 2010 at 3:46 AM, Simon Slavin  wrote:
> 
>> 
>> Does SQLite actually use byte-range locking ?  I thought it always locked
>> the entire file.
>> 
>> 
> Simon, I think it's about the way sqlite implements different locks, a quote
> from os.h
> 
> ** A SHARED_LOCK is obtained by locking a single randomly-chosen
> ** byte out of a specific range of bytes. ...

Oh, I see.  That's called semaphore locking.  I never realised SQLite used it.  
Thanks for the info.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sharing an SQLite database (using whole-file locking) over OpenAFS (Andrew File System)

2010-04-12 Thread Max Vlasov
On Tue, Apr 13, 2010 at 3:46 AM, Simon Slavin  wrote:

>
> Does SQLite actually use byte-range locking ?  I thought it always locked
> the entire file.
>
>
Simon, I think it's about the way sqlite implements different locks, a quote
from os.h

** A SHARED_LOCK is obtained by locking a single randomly-chosen
** byte out of a specific range of bytes. ...
** An EXCLUSIVE_LOCK is obtained by locking all bytes in the range.
** There can only be one writer.  A RESERVED_LOCK is obtained by locking
** a single byte of the file that is designated as the reserved lock byte.
** A PENDING_LOCK is obtained by locking a designated byte different from
** the RESERVED_LOCK byte.

It was a note about windows, but there's also a phrase "The same locking
strategy and byte ranges are used for Unix."

Max Vlasov,
maxerist.net
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sharing an SQLite database (using whole-file locking) over OpenAFS (Andrew File System)

2010-04-12 Thread Simon Slavin

On 13 Apr 2010, at 12:28am, Brandon Simmons wrote:

> On the OpenAFS mailing list, I was told that this might be problematic
> because of the lack of support for byte-range locking in OpenAFS, but
> that...

Does SQLite actually use byte-range locking ?  I thought it always locked the 
entire file.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users