[Python-Dev] The endless GIL debate: why not remove thread support instead? (original) (raw)

Sturla Molden sturla at molden.no
Fri Dec 12 12:23:34 CET 2008


On 12/12/2008 11:52 AM, Lennart Regebro wrote:

The use of threads for load balancing should be discouraged, yes. That is not what they are designed for. Threads are designed to allow blocking processes to go on in the background without blocking the main process.

It seems that most programmers with Java or Windows experience don't understand this; hence the ever lasting GIL debate.

With multiple interpreters - one interpreter per thread - this could still be accomplished. Let one interpreter block while another continues to work. Then the result of the blocking operation is messaged back. Multi-threaded C libraries could be used the in same way. But there would be no need for a GIL, because each interpreter would be a single-threaded compartment.

.NET have something similar in what is called 'appdomains'.

I am not suggesting removal of threads but rather the Java threading model. I just think it is a mistake to let multiple OS threads touch the same interpreter.

Sturla Molden



More information about the Python-Dev mailing list