Need advice on multithreading problem

Aahz aahz at pythoncraft.com
Tue Jun 4 10:02:17 EDT 2002


In article <slrnafpeei.p8.gerhard at developer2.opus-gmbh.net>,
Gerhard =?iso-8859-15?Q?H=E4ring?=  <gerhard at bigfoot.de> wrote:
>
>The problem is this: I have a C library with a function of the following
>interface:
>
>    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
>processing.
>
>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 pythoncraft.com)           <*>         http://www.pythoncraft.com/

"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