[Zope] system requirements

Matthew T. Kromer matt@zope.com
Tue, 04 Jun 2002 10:34:35 -0400


Matt Hamilton wrote:

>>I do *not* recommend running Zope on multiprocessor machines without an
>>ability to restrict Zope to execution on a single CPU.
>>
>>The reason for this is that the Python Global Interpreter Lock is shared
>>inside a Zope process. [...]
>>
>>    
>>
>
>Matt,
>  What does the GIL actually do?  What actions within the interpreter
>require the GIL?
>
>-Matt
>
>  
>

Sorry I didn't respond to this earlier -- I was out of the office.

The GIL prevents multiple Python interpreter threads from corrupting 
Python data by only allowing one thread to dispatch through the main 
interpreter loop at a time.

All Python data structures are protected by this singular lock.  Locking 
is thus very coarse grained, but fairly efficient -- were every data 
structure to have its own lock, the overhead of locking would become 
prohibitive.

Every action within the interpreter with a few very rare exceptions 
requires the GIL to be held by the invoking thread.

-- 
Matt Kromer
Zope Corporation  http://www.zope.com/