I'm trying to settle an argument with a coworker. Say that I have a Python 2.6 app that uses psycopg2
to communicate with a Postgres database. The app is multithreaded. When a thread makes a database call using psycopg2
, does it release the GIL so other threads could also make a database call?
From a quick glance at the Psycopg release notes, there are many references to releasing the GIL. So apparently it tries to release the GIL when appropriate. You didn't ask about a specific scenario, so I don't think a more specific answer is possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With