Re: Multi-threading Python

Guido.van.Rossum@cwi.nl
Mon, 06 Feb 1995 10:43:11 +0100

> How hard would it be (or is it already done in Python 1.2) to make the
> Python interpreter truly multi-threaded. I.E., Several interpreter
> threads and several additional compiled threads would be running at
> the same time.

Very hard. The trouble is that sharing Python objects between threads
requires very fine grain, and thus expensive (on most hardware),
locking.

> I have been thinking that a multi-threaded Python interpreter would
> make a great window system in the style of NeWS - the multiple threads
> are obviously to allow different client connections to have different
> context and permit a style of coding that lets little threads block on
> absent user-intput events.

Unfortunately, for most mortals, thread programming is just Too Hard
to get right... Even in Python -- every time someone gets into
serious thread programming, they send me tons of bug reports, and half
of them are subtle bugs in the Python interpreter, half of them are
subtle problems in their own understanding of the consequences of
multiple threads...

--Guido van Rossum, CWI, Amsterdam <mailto:Guido.van.Rossum@cwi.nl>
<http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>