Re: [sqlite] How lock is implemented upon write?

2019-07-05 Thread Jens Alfke
> On Jul 4, 2019, at 6:57 AM, Peng Yu wrote: > > So the fundamental C API that unix_os.c is based on is the only > following but nothing else? > > - fcntl: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html > - flock: https://www.freebsd.org/cgi/man.cgi?query=flock=2 I

Re: [sqlite] How lock is implemented upon write?

2019-07-05 Thread Keith Medcalf
On Friday, 5 July, 2019 12:26, Peng Yu : >There is something shown below that uses SQLite3, but it still does >not go deeper into reimplementing using the raw code available from >SQLite3. This implementation merely calls SQLite3.

Re: [sqlite] How lock is implemented upon write?

2019-07-05 Thread Peng Yu
> Here's my guess. OP is trying to implement locking in Python. OP sees that > SQLite does locking and wants to copy code. > > Obviously, that's beyond the range of this mailing list, but just to be > helpful, here's some stackoverflow: > >

Re: [sqlite] How lock is implemented upon write?

2019-07-04 Thread Simon Slavin
Here's my guess. OP is trying to implement locking in Python. OP sees that SQLite does locking and wants to copy code. Obviously, that's beyond the range of this mailing list, but just to be helpful, here's some stackoverflow:

Re: [sqlite] How lock is implemented upon write?

2019-07-04 Thread Adrian Ho
On 5/7/19 3:14 AM, Larry Brasfield wrote: > I notice that you have ignored repeated requests for insight into why > you have made your inquiry. People who may be able to help you with > your objective ask for such information because, often, that leads to > or permits a more direct solution to

Re: [sqlite] How lock is implemented upon write?

2019-07-04 Thread Larry Brasfield
Peng Yu wrote: >> So the fundamental C API that unix_os.c is based on is >> the only following but nothing else? >> [ followed by links to *nix C API fcntl(…) docs ] The (C and fundamental) API you cite is the interface provided for applications running on Unix-like operating systems to lock

Re: [sqlite] How lock is implemented upon write?

2019-07-04 Thread Peng Yu
So the fundamental C API that unix_os.c is based on is the only following but nothing else? - fcntl: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html - flock: https://www.freebsd.org/cgi/man.cgi?query=flock=2 On 7/3/19, Jens Alfke wrote: > >> On Jul 3, 2019, at 6:20 PM, Peng

Re: [sqlite] How lock is implemented upon write?

2019-07-03 Thread Jens Alfke
> On Jul 3, 2019, at 6:20 PM, Peng Yu wrote: > > Something in a higher level language (e.g., Python) that is easy to > run maybe better. Or at least some stand-alone C code (compilable to > executables) that is solely for the purpose of demonstrating the > locking mechanism. After you figure

Re: [sqlite] How lock is implemented upon write?

2019-07-03 Thread Peng Yu
Something in a higher level language (e.g., Python) that is easy to run maybe better. Or at least some stand-alone C code (compilable to executables) that is solely for the purpose of demonstrating the locking mechanism. The descriptions in os_unix.c don't satisfy these conditions. Just based on

Re: [sqlite] How lock is implemented upon write?

2019-07-03 Thread Keith Medcalf
On Wednesday, 3 July, 2019 11:59, Peng Yu wrote: >As I said in my original message "I am trying to understand how lock >is implemented in sqlite3". from os_unix.c: /* The following describes the implementation of the various locks and ** lock transitions in terms of the POSIX advisory

Re: [sqlite] How lock is implemented upon write?

2019-07-03 Thread Jens Alfke
> On Jul 3, 2019, at 10:59 AM, Peng Yu wrote: > > As I said in my original message "I am trying to understand how lock > is implemented in sqlite3". No offense, but I don’t think it’s reasonable to ask people to port code to Python just so you can figure out how it's implemented. If you’re

Re: [sqlite] How lock is implemented upon write?

2019-07-03 Thread Peng Yu
As I said in my original message "I am trying to understand how lock is implemented in sqlite3". On 7/2/19, Keith Medcalf wrote: > > On Tuesday, 2 July, 2019 13:26, Peng Yu : > >>I not sure how to use os_unix.c. Are there any easy to follow >>examples in python? > > YOU do not use os_unix.c.

Re: [sqlite] How lock is implemented upon write?

2019-07-02 Thread Keith Medcalf
On Tuesday, 2 July, 2019 13:26, Peng Yu : >I not sure how to use os_unix.c. Are there any easy to follow >examples in python? YOU do not use os_unix.c. Perhaps you can state what it is that you are trying to accomplish. For example: I would like to know how I drive a car to the

Re: [sqlite] How lock is implemented upon write?

2019-07-02 Thread David Raymond
for Windows. -Original Message- From: sqlite-users On Behalf Of Peng Yu Sent: Tuesday, July 02, 2019 3:26 PM To: SQLite mailing list Subject: Re: [sqlite] How lock is implemented upon write? I not sure how to use os_unix.c. Are there any easy to follow examples in python? On Mon, Jul

Re: [sqlite] How lock is implemented upon write?

2019-07-02 Thread Peng Yu
I not sure how to use os_unix.c. Are there any easy to follow examples in python? On Mon, Jul 1, 2019 at 9:08 PM Simon Slavin wrote: > You might want to take a look at the standard VFSen: > > > > At a low level, SQLite depends on the

Re: [sqlite] How lock is implemented upon write?

2019-07-01 Thread Simon Slavin
You might want to take a look at the standard VFSen: At a low level, SQLite depends on the VFS for reliable locking. The main parts of SQLite call a routine supplied by the VFS. The VFS does the actual locking. If we didn't answer