[pypy-dev] pypy c++ embedding multithread GIL

2016-10-23 Thread 手游引擎组|田凯
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 cod

[pypy-dev] PyGILState_Ensure will deadlock

2016-10-23 Thread 风云
We have an extension module which works fine with CPython but deadlocks every time in PyPy , same as the links below, pypy version is the latest (v5.4.1) Is this issue been fixed or other reasons lead to this ? https://bitbucket.org/pypy/pypy/issues/1778 __

Re: [pypy-dev] RFC: draft idea for making for loops automatically close iterators

2016-10-23 Thread Steven D'Aprano
On Sun, Oct 23, 2016 at 01:23:25AM +0200, Armin Rigo wrote: > Hi Steven, > > On 22 October 2016 at 01:13, Steven D'Aprano wrote: > > Saving lives? That's a bit of an exaggeration, isn't it? > > > > There is a big discussion going on over on the Python-Ideas mailing > > list, and exaggerated, over

Re: [pypy-dev] RFC: draft idea for making for loops automatically close iterators

2016-10-23 Thread hubo
Well the code don't appear to be broken, in fact they have been working well for serveral months with PyPy, it only means the design is broken - there are chances that iterators are not closed correctly in certain circumstances which leads to unpredictable behaviors. It might not be critical for

Re: [pypy-dev] RFC: draft idea for making for loops automatically close iterators

2016-10-23 Thread Armin Rigo
Hi, On 24 October 2016 at 06:03, hubo wrote: > long time, which is what PyPy is for. Files may not be the most critical > problem, the real problem is LOCK - when you use with on a lock, there are > chances that it never unlocks. Bah. I would say that it makes the whole "with" statement pointle

Re: [pypy-dev] PyGILState_Ensure will deadlock

2016-10-23 Thread Armin Rigo
Hi, On 21 October 2016 at 09:03, 风云 wrote: > We have an extension module which works fine with CPython but deadlocks > every time in PyPy , same as the links below, pypy version is the latest > (v5.4.1) > Is this issue been fixed or other reasons lead to this ? > > https://bitbucket.org/pypy/pypy