Re: Handling notices, warnings, etc.

Federico Di Gregorio <fog-NGVKUo/i/[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Organization initd.org
Message-ID <1243938865.4230.0.camel@erin>
Il giorno mar, 02/06/2009 alle 01.57 +1000, Joel Nothman ha scritto:
> >> Your patch makes psycopg lock other Python threads during the execution
> >> of possibly slow libpq calls. PyGILState_XXX functions are supposed to
> >> be used from C threads to acquire the GIL and allow the execution of
> >> Python API calls (locking out other threads) but we don't need that
> >> because the code is already executing as a Python thread.
> > You probably just want to put PyGILState_XXX around the Python API call
> > in the notice processor.
> 
> Thanks Frederico. Much appreciated. I found the API documentation quite  
> unclear as to the role of PyGILState_XXX (but I haven't dealt much with  
> concurrency handling in a few years). And so I wasn't sure whether it did  
> one thing or its reverse!
> 
> Using Ensure only for the API call, the updated diff is attached.

Hi,

your patch seems fine. I'll apply it after the 2.1 release.

federico

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                [email protected]
INIT.D Developer                                           fog-NGVKUo/i/[email protected]
 I porcellini di terra sono davvero Crostacei! Non lo sapevo!
  Certo che sono crostacei, hanno la crosta!
  Allora la pizza è un crostaceo?!               -- discorso all'ESC2k07

_______________________________________________
Psycopg mailing list
Psycopg-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/psycopg
signature.asc (application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAkolACsACgkQvcCgrgZGjesSbQCeLx+8crghEw4ZAkck1gK1ZJ7v
hW0AoMQxitSaJPAKPdtPVBP91LZs4Y/S
=DfvD
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.