[SciPy-user] conforming to Python GIL...

Travis E. Oliphant oliphant@enthought....
Thu Apr 3 20:58:18 CDT 2008

Anne Archibald wrote:
> On 03/04/2008, fred <fredmfp@gmail.com> wrote:
>> Travis E. Oliphant a écrit :
>>  > This requires a bit of effort to solve.   We need to in multiple places...
>> Hum, I do understand, but...
>>  It's very hard to believe that I am the only guy in the entire universe
>>  who encounters this kind of issue, uh ? ;-)))
>>  IOW... how do scipy users do ???
> You're not; it's in the FAQ, and there's a page devoted to it:
> http://www.scipy.org/ParallelProgramming
> I am surprised by the *particular* problem you have, that is, that the
> GIL is not released *at all* for long periods by scipy; I think most
> large pieces of compiled code in numpy/scipy operate outside the GIL
> (and interpreted code releases the GIL frequently). This makes it not
> just a parallel processing issue.
I'm surprised that f2py is not helping us release the GIL more often.  
On the other-hand, releasing the GIL automatically is dangerous if the 
code  that could possibly execute in the same thread is not re-entrant. 

I had thought that f2py was releasing the GIL more often than it 
actually is.   This is a problem and should be fixed -- perhaps by the 
addition of a default semaphore for code that may not be re-entrant.  

-Travis O.

More information about the SciPy-user mailing list