mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2026-03-13 08:00:02 +08:00
11
README.md
11
README.md
@@ -21,6 +21,17 @@ Or when you have question about MySQL/MariaDB:
|
||||
* [MySQL Support](https://dev.mysql.com/support/)
|
||||
* [Getting Help With MariaDB](https://mariadb.com/kb/en/getting-help-with-mariadb/)
|
||||
|
||||
## Free threading Python
|
||||
|
||||
> [!NOTE]
|
||||
> The support for Free threading Python is experimental.
|
||||
|
||||
Since v2.2.8, free threading is supported when importing the extension module. Therefore, importing MySQLdb does not acquire GIL.
|
||||
|
||||
However, this library does not support simultaneous operations on a single Connection object from multiple threads, regardless of free threading, and the behavior in such cases remains undefined.
|
||||
|
||||
> [!WARNING]
|
||||
> Do not use a single Connection object from multiple threads simultaneously.
|
||||
|
||||
## Install
|
||||
|
||||
|
||||
@@ -2911,7 +2911,9 @@ PyInit__mysql(void)
|
||||
|
||||
module = PyModule_Create(&_mysqlmodule);
|
||||
if (!module) return module; /* this really should never happen */
|
||||
|
||||
#ifdef Py_GIL_DISABLED
|
||||
PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED);
|
||||
#endif
|
||||
if (!(dict = PyModule_GetDict(module))) goto error;
|
||||
if (PyDict_SetItemString(dict, "version_info",
|
||||
PyRun_String(QUOTE(version_info), Py_eval_input,
|
||||
|
||||
Reference in New Issue
Block a user