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

Raphael de Feraudy feraudy@phimeca....
Mon Sep 24 10:54:14 CDT 2012


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.



More information about the NumPy-Discussion mailing list