[Numpy-discussion] Long-standing issue with using numpy in embedded CPython

Aron Ahmadia aron@ahmadia....
Tue Sep 25 06:10:10 CDT 2012


Can you expand a bit?  Are you trying to disable threads at
compile-time or at run-time?  Which threaded functionality are you
trying to disable?  Are you using numpy as a computational library
with multiple threads making calls into its functions?  I think
NPY_ALLOW_THREADS is for interacting with the GIL, but I have not
played with it much.

A

On Mon, Sep 24, 2012 at 6:54 PM, Raphael de Feraudy <feraudy@phimeca.com> wrote:
> Yang Zhang <yanghatespam <at> gmail.com> writes:
>
>>
>> > I'm curious how to disable threads in numpy (not an ideal solution).
>> > Googling seems to point me to setting NPY_ALLOW_THREADS to
>> > 0....somewhere.
>>
>> Anyone?
>>
>
> It's appearing to me I had to face this very issue,
> which I reported @Numpy TRAC : http://projects.scipy.org/numpy/ticket/2213.
>
> I just tried your suggestion :
> set NPY_ALLOW_THREADS to 0 in numpy/core/include/numpy/ndarraytypes.h.
> It allowed my atomic example to run without stalling,
> and also fixed the issue in my application.
>
> Though i'm not entirely satisfied by this workaround,
> which might slow down heavy computations.
> I also find it too intrusive in numpy source code
> and don't wish to maintain a powerless numpy fork.
>
> Has anyone else settled with this fix ?
> Or may anybody have any other suggestion / comments ?
>
> Thanks.
> Raphael.
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion


More information about the NumPy-Discussion mailing list