Hi, On 20 October 2016 at 05:58, 手游引擎组|田凯 <tkn0...@corp.netease.com> wrote: > c++ code: (thread func, multi thread will call cpp_work) > void cpp_work() > { > //how to get pypy GIL ( I ues PyGILState_Ensure but blocked here for ever) > work_callback() //call python func > //release GIL (PyGILState_Release(state) > }
You don't explain how ``work_callback()`` calls the Python function. Maybe it is a CFFI callback? In that case, the GIL is acquired automatically and you should not call any of the PyXxx functions from the CPython C API. A bientôt, Armin. _______________________________________________ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev