bcdev / jpy

A bi-directional Python-Java bridge used to embed Java in CPython or the other way round.
Apache License 2.0
187 stars 37 forks source link

GIL audit? #162

Open devinrsmith opened 5 years ago

devinrsmith commented 5 years ago

I'm not an expert on the GIL / Python C api, but the documentation suggests that every single API call needs to be executed within the context of a held GIL lock: "... only the thread that has acquired the GIL may operate on Python objects or call Python/C API functions."

I've noticed a few places where the GIL isn't being acquired: Java_org_jpy_PyLib_newDict and Java_org_jpy_PyLib_copyDict (a non-exhaustive search). Should these places acquire the GIL?