Will multithreading make python less popular?

Tim Rowe digitig at gmail.com
Mon Feb 16 06:07:49 EST 2009


2009/2/16  <rushenaly at gmail.com>:
> Hi everybody,
> I am an engineer. I am trying to improve my software development
> abilities. I have started programming with ruby. I like it very much
> but i want to add something more. According to my previous research i
> have designed a learning path for myself. It's like something below.
>      1. Ruby (Mastering as much as possible)
>      2. Python (Mastering as much as possible)
>      3. Basic C++ or Basic Java
> And the story begins here. As i search on the net,  I have found that
> because of the natural characteristics of python such as GIL, we are
> not able to write multi threaded programs. Oooops, in a kind of time
> with lots of cpu cores and we are not able to write multi threaded
> programs. That is out of fashion. How a such powerful language doesn't
> support multi threading. That is a big minus for python.

In a way, you've answered your own question. Why are you learning
three languages? Perhaps you've already realised that being
Turing-complete isn't the last word in language choice; that different
languages make different compromises, so the best language for one
task may not be the best language for a different task. Ok, Python
doesn't cope well with threading. It doesn't cope well with hard
real-time, either. So what? A deep saucepan isn't much use for making
an omlette (it can be done, but it's inefficient), but it's ideal for
making soup. Just because multiple cores are available doesn't mean
they will help your program significantly. Most real-world programs
work just fine in a single core, and it usually just isn't worth all
of the extra design effort, coding effort and debugging effort of
threading to cut the user response time down from a tenth of a second
to a twentieth. For *most* applications the single-thread Python
programmer will have something written, shipped and doing the job
whilst the multi-thread programmer is still trying to debug an
intermittent livelock that goes away whenever instrumentation is
added.  For those few cases where threading is a genuine advantage,
Python is not ideal. But in the real world I doubt they're enough to
make a significant dent in Python's popularity.

-- 
Tim Rowe



More information about the Python-list mailing list