Re: [pysqlite] Concurrency - first steps

"Hugh Gibson" <hgibson-CVW/MsmY5bNaa/[email protected]> Tue, 18 Nov 2008 22:02 +0000 (GMT Standard Time)
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
> threading.local is a global struct.  It is just a dict with the keys
> being the thread id.  No need for a lock since the thread id is 
> unique.

And GIL means that working with the dict is threadsafe? In my own
programming I always put a lock around that sort of access - maybe I
don't need to.
 
> > Do you mean if we use a common connection object, 
> 
> I meant if you were using the same connection object in multiple
> threads.  To be able to do that with pysqlite you have to supply the
> (undocumented) check_same_thread=False parameter to connect.

Sounds like we're OK. I don't need to know the gory details, thanks!
 
Hugh