[Python-Dev] Extension modules, Threading, and the GIL (original) (raw)
"Martin v. L�wis" martin@v.loewis.de
Wed, 08 Jan 2003 14:26:13 +0100
- Previous message: [Python-Dev] Extension modules, Threading, and the GIL
- Next message: [Python-Dev] Extension modules, Threading, and the GIL
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Mark Hammond wrote:
1) Allow "arbitrary" threads (that is, threads never before seen by Python) to acquire the resources necessary to call the Python C API.
This is possible today, all you need is a pointer to an interpreter state. If you have that, you can use PyThreadState_New, PyEval_AcquireThread, after which you have the resources necessary to call the Python API.
In many cases, extensions can safely assume that there is exactly one interpreter state all the time, so they can safe the interpreter pointer in their init function.
Regards, Martin
- Previous message: [Python-Dev] Extension modules, Threading, and the GIL
- Next message: [Python-Dev] Extension modules, Threading, and the GIL
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]