Roger Binns <rog...@rogerbinns.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 06/15/2010 06:48 PM, Igor Tandetnik wrote:
>> Well, what trick? There is no way I know of for another process to get 
>> notified of changes to the database. That is, other than
>> polling, or a side channel independent of SQLite. 
> 
> One way I have done it in the past is to have a second database that is
> exclusively locked by whoever does writing.  Waiters then also try a begin
> immediate with infinite timeouts.  After the writer updates the main
> database they release the lock on the second one which wakes up all the
> waiters.  Rinse and repeat.

That's just polling, really. SQLite's busy handler tries to access the 
database, sleeps a little, tries again, sleeps again, and so on. It's not 
"woken up" the way, say, a thread waiting on a mutex would be.
-- 
Igor Tandetnik

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

Reply via email to