This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author loewis
Recipients amaury.forgeotdarc, ghaering, loewis
Date 2008-09-12.19:38:30
SpamBayes Score 1.6818129e-07
Marked as misclassified No
Message-id <48CAC534.7090200@v.loewis.de>
In-reply-to <1221247320.71.0.666478867637.issue3846@psf.upfronthosting.co.za>
Content
> This has nothing to do with releasing/aquiring the GIL around
> sqlite3_prepare, though. 

You mean, it doesn't make things worse, but I believe they do
(even if so only slightly). If you have two threads simultaneously
attempting an execute on a cursor, one will run into the prepare.

That thread will (now) release the GIL, allowing the second thread
to run into the prepare. That thread will replace the statement object
in the cursor, so when the first thread returns, the statement has
changed underneath, and it will associate any return code with the
incorrect statement object.

In this form, this can't currently happen. Without detailed review,
I can readily believe that there are many other cases where a
False check_same_thread can give surprising results.

> They're there for all other nontrivial SQLite API calls (sqlite3_step,
> sqlite3_reset, sqlite3_open, sqlite3_finalize and also already for the
> "BEGIN"/"COMMIT" and "ROLLBACK" versions of sqlite3_prepare in connection.c.

On the grounds that the code is already full of these GIL release calls,
I'll approve this additional one.

I encourage you to review the entire issue, though, and document
somewhere what promises are made under what conditions. Then a later
review can validate that the promises are really kept.
History
Date User Action Args
2008-09-12 19:38:31loewissetrecipients: + loewis, ghaering, amaury.forgeotdarc
2008-09-12 19:38:30loewislinkissue3846 messages
2008-09-12 19:38:30loewiscreate