Dag Sverre Seljebotn skrev:
> Out of curiosity, does it happen often that NumPy does not release the 
> GIL? 
As Robert Kern said, ufuncs release the GIL. The rest of NumPy, does not 
(including FFTs and linear algebra).

SciPy more or less never releases the GIL from C or Fortran.


> Because of necessity or because it's just not been implemented?
>
>   

Both, I think.

Out of necessity e.g. because array iterators are Python objects. At least you 
need the GIL to create them and decref when you are done. 

One has to consider that the bulk of NumPy's C was written in the 1990s when 
multithreading was less important minor issue. Well... It's not just a 
multicore issue, though. Releasing the GIL is also required to maintain 
responsiveness of the interpreter, e.g. for server and GUI programs. 

In an ideal world, all of NumPy's C would be replaced with Cython. That would 
make porting to Python 3 easier as well.


 



_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to