My program is programed mixing with python and c++.

Program runs in pypy, using c++ extending( mylib.so). mylib.so is 
multi-threaded. How could I get pypy GIL to ensure sync when c++ calls python 
function ?
My program runs flow as example: Is there any other api or my use is wrong ? 

python code:
def work_callback():
pass
def work():
lib.cpp_work() 

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)
}
2016-10-20
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to