MySQL Forums
Forum List  »  Connector/Python

Re: Python thread insertion with MySQL
Posted by: joseph sheedy
Date: April 25, 2005 05:11PM

As you discovered, you don't want to share a connection between threads without locking it down. Is locking the connection a suitable solution? Otherwise, either create one connection for each thread, or create a connection pool which threads can pull a connection from. If threads aren't being launched rapid fire, you can often get away with creating new connections as needed, since MySQL connection happens so quickly.

Improving Python performance using threads is a tricky subject, since it has that pesky global interpreter lock (GIL).

Options: ReplyQuote

Written By
Re: Python thread insertion with MySQL
April 25, 2005 05:11PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.