Re: [sqlite] Writer Starvation Question

2008-04-22 Thread Teg
Hello Fin, It sounds like you're creating inserts faster than you can actually insert them in the DB so, things are backing up. In this case, it's the second worker that's backing up. I'd use a single worker thread that accepts DB requests from the other worker threads then queue jobs to the

Re: [sqlite] Writer Starvation Question

2008-04-22 Thread Fin Springs
On Apr 22, 2008, at 6:52 PM, Igor Tandetnik itandetnik-at-mvps.org | sqlite| wrote: > Have thread B let thead A know that it wants in by using some > synchronization primitive. E.g on Windows I'd use a manual reset > event. > Thread A waits on the event at the top of the loop. The event is

Re: [sqlite] Writer Starvation Question

2008-04-22 Thread Fin Springs
On Apr 22, 2008, at 6:52 PM, Scott Hess shess-at-google.com |sqlite| wrote: > Weirdo response, but ... make sure you have HAVE_USLEEP defined. We > kept seeing something similar, and kept looking at the code for > sqliteDefaultBusyCallback(), and the code looked right, but the > problem

Re: [sqlite] Writer Starvation Question

2008-04-22 Thread Igor Tandetnik
Fin Springs <[EMAIL PROTECTED]> wrote: > I am using SQLite 3.5.7. This is a simplified example, but I have 2 > threads in the same process, each with their own connection, and cache > sharing disabled. > > Thread A does: > > while (some condtion) > BEGIN IMMEDIATE > do some INSERTs > COMMIT > >

Re: [sqlite] Writer Starvation Question

2008-04-22 Thread Scott Hess
Weirdo response, but ... make sure you have HAVE_USLEEP defined. We kept seeing something similar, and kept looking at the code for sqliteDefaultBusyCallback(), and the code looked right, but the problem remained, until we eventually started questioning every assumption. At which point we found

[sqlite] Writer Starvation Question

2008-04-22 Thread Fin Springs
I am using SQLite 3.5.7. This is a simplified example, but I have 2 threads in the same process, each with their own connection, and cache sharing disabled. Thread A does: while (some condtion) BEGIN IMMEDIATE do some INSERTs COMMIT Thread B occasionally wants to