[NumPy-Tickets] [NumPy] #1470: Improve docs for writing new ufuncs (e.g. explain GIL issues) (was: Segmentation fault while trying to raise an exception in Ufunc)

NumPy Trac numpy-tickets@scipy....
Sun May 2 06:07:45 CDT 2010


#1470: Improve docs for writing new ufuncs (e.g. explain GIL issues)
---------------------------+------------------------------------------------
 Reporter:  kishor.iitr    |       Owner:  pv         
     Type:  enhancement    |      Status:  new        
 Priority:  low            |   Milestone:  Unscheduled
Component:  Documentation  |     Version:  devel      
 Keywords:                 |  
---------------------------+------------------------------------------------
Changes (by pv):

  * component:  Other => Documentation
  * priority:  normal => low
  * version:  => devel
  * milestone:  => Unscheduled
  * owner:  somebody => pv
  * type:  defect => enhancement


Comment:

 The ufunc loop runs with GIL released (cf.
 http://docs.scipy.org/doc/numpy/reference/internals.code-
 explanations.html?highlight=gil#function-call). You need to re-acquire the
 GIL before calling Python routines. The easiest way is to use the
 NPY_ALLOW_C_API macros, see:

 http://docs.scipy.org/doc/numpy/reference/c-api.array.html?highlight=allow_c_api#group-2

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1470#comment:2>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list