[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

SQLite and callbacks

From: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: Mon, 29 Nov 2010 19:43:40 -0600

We use callbacks extensively throughout our code as a means of
providing streamy feedback to callers. It's a pretty good paradigm,
and one that has served us well. We don't put many restrictions on
what the callbacks can do in terms of fetching more information or
calling other functions.

Enter wc-ng.

Stefan's patch to make a recursive proplist much more performant
highlights the great benefit that our sqlite-backed storage can have.
However, he reverted it due to concerns about the potential for
database contention. The theory was that the callback might try and
call additional wc functions to get more information, and such nested
statements weren't healthy for sqlite. We talked about it for a bit
in IRC this morning, and the picture raised by this issue was quite
dire.

In an attempt to find out what the consequences of these nested
queries are, I wrote a test program to attempt to demonstrate the
failure, only now I can't seem to do so. Attached is the test
program, but when I run it, I'm able to successfully execute multiple
prepared statements on the same set of rows simultaneously, which was
the concern we had about our callback mechanism in sqlite.

So is this a valid problem? If so, could somebody use the attached
test program to illustrate it for those of us who may not fully
understand the situation?

Thanks,
-Hyrum

  • text/x-csrc attachment: test.c
Received on 2010-11-30 02:44:21 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.