Re: [sqlite] One more SQLite threading question

2007-05-19 Thread John Stanton
Doug Nebeker wrote: Yes I did the same experiment with a lock that made thread A wait until B was finished. So actually only one thread can be active at the time. I don't see how the outcome of this experiment can be of any interest, as there is no time reduction any longer. But your

Re: [sqlite] One more SQLite threading question

2007-05-19 Thread John Stanton
You can get what you want right now. It is called PostgreSQL. Ken wrote: I would be interested in a version of SQLITE that handled threading in a much cleaner way. I have a need for a single process version that is threaded. But, where SQLITE locking is concerned each thread is really like

RE: [sqlite] One more SQLite threading question

2007-05-19 Thread Dan Kennedy
On Fri, 2007-05-18 at 11:46 -0700, Ken wrote: > Dan, > Can you explain to me how within the context of the test_server.c code > that the > sqlite3_enable_shared_Cache will improve concurrency, for a single DB > file access? Others have pointed out in the past that in many cases using a

RE: [sqlite] One more SQLite threading question

2007-05-18 Thread Ken
Dan, Can you explain to me how within the context of the test_server.c code that the sqlite3_enable_shared_Cache will improve concurrency, for a single DB file access? I just don't see where any concurrency is gained. Sure maybe some memory savings. But I must be brain dead, because I

RE: [sqlite] One more SQLite threading question

2007-05-18 Thread Ken
I would be interested in a version of SQLITE that handled threading in a much cleaner way. I have a need for a single process version that is threaded. But, where SQLITE locking is concerned each thread is really like a seperate Database connection. The locking occurs as a part of the Pager

RE: [sqlite] One more SQLite threading question

2007-05-18 Thread Doug Nebeker
> > Yes I did the same experiment with a lock that made thread A wait > > until B was finished. So actually only one thread can be active at the time. > > I don't see how the outcome of this experiment can be of any > > interest, as there is no time reduction any longer. But your guess is >

Re: [sqlite] One more SQLite threading question

2007-05-18 Thread Martin Gentry
.org Subject: Re: [sqlite] One more SQLite threading question On Thu, 2007-05-17 at 18:26 -0400, Martin Gentry wrote: > Can you be a bit more specific? :-) I ask because this is immediately > relevant to some code I'm writing today, and have been operating on the > understanding that I shou

Re: [sqlite] One more SQLite threading question

2007-05-18 Thread Dan Kennedy
sers@sqlite.org> > Sent: Thursday, May 17, 2007 5:01 PM > Subject: Re: [sqlite] One more SQLite threading question > > > "Martin Gentry" <[EMAIL PROTECTED]> wrote: > > Just as an FYI on the threading ... > > http://www.sqlite.org/capi3ref.html#sqlite3_o

Re: [sqlite] One more SQLite threading question

2007-05-17 Thread John Stanton
Ed Pasma wrote: However, it would be too time consuming to serialize every call to sqlite3_step(), so I wonder whether it can be called in another thread. This almost immediately raises "library routine called out of sequence". It occurs as soon as the processing of A and B overlap, that

Re: [sqlite] One more SQLite threading question

2007-05-17 Thread Martin Gentry
have to. - Original Message - From: <[EMAIL PROTECTED]> To: <sqlite-users@sqlite.org> Sent: Thursday, May 17, 2007 5:01 PM Subject: Re: [sqlite] One more SQLite threading question "Martin Gentry" <[EMAIL PROTECTED]> wrote: Just as an FYI on the threadi

Re: [sqlite] One more SQLite threading question

2007-05-17 Thread drh
"Martin Gentry" <[EMAIL PROTECTED]> wrote: > Just as an FYI on the threading ... > http://www.sqlite.org/capi3ref.html#sqlite3_open > > "The returned sqlite3* can only be used in the same thread in which it was > created. It is an error to call sqlite3_open() in one thread then pass the >

Re: [sqlite] One more SQLite threading question

2007-05-17 Thread Martin Gentry
:18 PM Subject: Re: [sqlite] One more SQLite threading question However, it would be too time consuming to serialize every call to sqlite3_step(), so I wonder whether it can be called in another thread. This almost immediately raises "library routine called out of sequence". It o

Re: [sqlite] One more SQLite threading question

2007-05-17 Thread Ed Pasma
However, it would be too time consuming to serialize every call to sqlite3_step(), so I wonder whether it can be called in another thread. This almost immediately raises "library routine called out of sequence". It occurs as soon as the processing of A and B overlap, that means A is preparing

Re: [sqlite] One more SQLite threading question

2007-05-17 Thread Jiri Hajek
This almost immediately raises "library routine called out of sequence". It occurs as soon as the processing of A and B overlap, that means A is preparing statement #2 while B is still executing #1. Have you tried using Mutex or some other way to prevevent really simultaneous calling of SQLite

Re: [sqlite] One more SQLite threading question

2007-05-16 Thread Andrew Finkenstadt
I have recently encountered the same cross-thread library misuse bug, and ended up re-implement a C++ wrapper to be thread-aware and thread-safe. It's not yet feature complete, compared to CPPSQLite3DB, but it does have several good enhancements: * signed 64-bit integer parameter binding

Re: [sqlite] One more SQLite threading question

2007-05-16 Thread Ed Pasma
Hello, I have no inside-knowledge from SQLite, but I'am in the circumstance to easily do this experiment. Hope I understand it right and that you consider a sort of pipe-lining. Anyway, I started the two threads A and B, and made A exclusively do all the sqlite3_prepare calls, and B the

[sqlite] One more SQLite threading question

2007-05-14 Thread Jiri Hajek
Hello, I have tried to search all the documentation about threading in SQLite, but I'm still somewhat confused. It's often suggested to create a pool of sqlite3 structures, but what if I would like to have only only sqlite3 connection and serialize all the DB operations to one thread (name it