scipy/scipy — pull request #3477 by pv (2014-03-22 14:45:36+00:00)
Title: ENH: sparse: release GIL in sparsetools routines

The sparsetools routines are threadsafe, and do not use Python. This PR releases GIL when calling them.

The GIL release is thresholded to not occur for small arrays.

The exact threshold value is probably not exact science. Numpy ufunc loops threshold at 500 elements, but on the other hand, sparsetools routines are somewhat more complicated than typical ufunc inner loops.