Re: [Numpy-discussion] numpy threads crash when allocating arrays

2016-06-16 Thread Burlen Loring
On 06/14/2016 01:05 PM, Nathaniel Smith wrote: On Jun 14, 2016 12:38 PM, "Burlen Loring" > wrote: > > On 06/14/2016 12:28 PM, Julian Taylor wrote: >> >> On 14.06.2016 19:34, Burlen Loring wrote: >> >>> >>> here's my question: given Py_BEGIN_ALLOW_THREADS is used by numpy

Re: [Numpy-discussion] numpy threads crash when allocating arrays

2016-06-14 Thread Nathaniel Smith
On Jun 14, 2016 12:38 PM, "Burlen Loring" wrote: > > On 06/14/2016 12:28 PM, Julian Taylor wrote: >> >> On 14.06.2016 19:34, Burlen Loring wrote: >> >>> >>> here's my question: given Py_BEGIN_ALLOW_THREADS is used by numpy how >>> can numpy be thread safe? and how can someone using the C-API know

Re: [Numpy-discussion] numpy threads crash when allocating arrays

2016-06-14 Thread Burlen Loring
On 06/14/2016 12:28 PM, Julian Taylor wrote: On 14.06.2016 19:34, Burlen Loring wrote: here's my question: given Py_BEGIN_ALLOW_THREADS is used by numpy how can numpy be thread safe? and how can someone using the C-API know where it's necessary to acquire the GIL? Maybe someone can explain thi

Re: [Numpy-discussion] numpy threads crash when allocating arrays

2016-06-14 Thread Julian Taylor
On 14.06.2016 19:34, Burlen Loring wrote: here's my question: given Py_BEGIN_ALLOW_THREADS is used by numpy how can numpy be thread safe? and how can someone using the C-API know where it's necessary to acquire the GIL? Maybe someone can explain this? numpy only releases the GIL when it is n

Re: [Numpy-discussion] numpy threads crash when allocating arrays

2016-06-14 Thread Burlen Loring
Nathaniel, Thanks for the feedback. Investigations made where I acquire GIL in spots where I already hold it lead me to suspect that the issue is caused by use of Py_BEGIN_ALLOW_THREADS or another macro NPY_BEGIN_ALLOW_THREADS. to put this point to rest, I have a high degree of confidence in o

Re: [Numpy-discussion] numpy threads crash when allocating arrays

2016-06-13 Thread Nathaniel Smith
Hi Burlen, On Jun 13, 2016 5:24 PM, "Burlen Loring" wrote: > > Hi All, > > I'm working on a threaded pipeline where we want the end user to be able to > code up Python functions to do numerical work. Threading is all done in C++11 > and in each thread we've acquired gill before we invoke the us