Hi Omer, On 20 June 2016 at 08:51, Omer Katz <omer.drow@gmail.com> wrote:
As for implementation, if we can trace the code running in the thread and ensure it's not mutating global state and that CPyExt is never used during the thread's course we can simply release the GIL when such a thread is run.
That's a very hand-wavy and vague description. To start with, how do you define exactly "not mutating global state"? We are not allowed to write to any of the objects that existed before we started the thread? It may be possible to have such an implementation, yes. Actually, that's probably easy: tweak the STM code to crash instead of doing something more complicated when we write to an old object. I'm not sure how useful that would be---or how useful PyParallel is on CPython. Maybe if you can point us to real usages of PyParallel it would be a start. A bientôt, Armin.