taminob / ppplugin

C++ Library for managing multi-language plugins to dynamically extend a compiled binary
MIT License
0 stars 0 forks source link

Python plugin multithreading support #7

Closed taminob closed 3 months ago

taminob commented 3 months ago

This PR introduces multi-threading support for different instances of PythonPlugin. Previously, due to the global state used internally in the CPython library, two different plugins could not be used thread-safely.

This is achieved by using the Global Interpreter Lock (GIL) and (for Python 3.12 or newer) different sub-interpreters.

However, sub-interpreters are poorly documented and thus the implementation might not be perfect and still have some thread-unsafe calls.

Resolves #6