decorators vs GIL

Daniel Dittmar daniel at dittmar.net
Tue Aug 10 16:12:27 EDT 2004


Christopher T King wrote:
> The real reason behind the GIL is that the Python interpreter is not
> re-entrant; it keeps internal state in a global structure which must be
> switched out (and stored somewhere) on thread changes.  The real solution
> to this problem is to make the interpreter stateless, thus obviating the
> need for the GIL entirely.  I think this task would be much easier to do
> in Stackless than in CPython, but I may be wrong.

Another reason is reference counting, which must be synchronized.

Daniel



More information about the Python-list mailing list