Need advice on multithreading problem

Aahz aahz at
Tue Jun 4 16:02:17 CEST 2002

In article <slrnafpeei.p8.gerhard at>,
Gerhard =?iso-8859-15?Q?H=E4ring?=  <gerhard at> wrote:
>The problem is this: I have a C library with a function of the following
>    def sqlite_exec(conn, sql, callback, arg1):
>The only important parameter here is 'callback', it is a callback
>function that you need to give to sqlite_exec. The callback function
>will be called with the items sqlite_exec returns. If the callback
>functions returns a value other than zero, sqlite_exec will stop its
>On the Python side, I wanted to force this C library call into a
>generator.  Which I did using a thread that's spawned for a new
>sqlite_exec call and Queue.Queue.

Is SQLite thread-safe?  Do you provide a thread-local conn?  Does
sqlite_exec() return a brand-new cursor?  If the answer to any question
is "no", your code is probably broken (haven't actually read it).
Aahz (aahz at           <*>

"In the end, outside of spy agencies, people are far too trusting and
willing to help."  --Ira Winkler

More information about the Python-list mailing list