Re: global interpreter lock



In article <91nNe.620$zD3.198@xxxxxxxxxxxxxxxxxxxxxxxxxx>,
Bryan Olson <fakeaddress@xxxxxxxxxxx> wrote:

> km wrote:
> > Hi all,
> >
> > is true parallelism possible in python ? or atleast in the
> > coming versions ? is global interpreter lock a bane in this
> > context ?
>
> No; maybe; and currently, not usually.
>
> On a uniprocessor system, the GIL is no problem. On multi-
> processor/core systems, it's a big loser.

I rather suspect it's a bigger winner there.

Someone who needs to execute Python instructions in parallel
is out of luck, of course, but that has to be a small crowd.
I would have to assume that in most applications that need
the kind of computational support that implies, are doing most
of the actual computation in C, in functions that run with the
lock released. Rrunnable threads is 1 interpreter, plus N
"allow threads" C functions, where N is whatever the OS will bear.

Meanwhile, the interpreter's serial concurrency limits the
damage. The unfortunate reality is that concurrency is a
bane, so to speak -- programming for concurrency takes skill
and discipline and a supportive environment, and Python's
interpreter provides a cheap and moderately effective support
that compensates for most programmers' unrealistic assessment
of their skill and discipline. Not that you can't go wrong,
but the chances you'll get nailed for it are greatly reduced -
especially in an SMP environment.

Donn Cave, donn@xxxxxxxxxxxxxxxx
.



Relevant Pages

  • Re: Advanced concurrancy
    ... It feels quite familiar, but i'd say that it is closer to Jade, the fipa compliant agent framework than CSP or pi calculus. ... I'll probably zip the Axion directory and distribute the zip with the code, adding the zip to the python path dynamically. ... I'm looking for an advanced concurrency module for python and don't seem ... of the year, learn python, Kamaelia, and build a simple streaming system taking a video file, taking snapshots and sending those to mobile phones and PC's - this was over a period of 3 months. ...
    (comp.lang.python)
  • Re: Advanced concurrancy
    ... > Stackless but i'd like students to be able to use a standard python build. ... The basic idea in Kamaelia is you have a class that represents a concurrent ... pre-university trainees, and vacation trainees, and found they're able to ... We're essentially working on making concurrency easy and natural to use, ...
    (comp.lang.python)
  • Re: Multicore-programming?
    ... would that be distributed across the cores? ... One particular program has to be programmed for concurrency to utilize ... Threading with Python is perhaps a bit easier than with other common ... dealing with bad bottlenecks in numerical computing. ...
    (comp.lang.python)
  • Re: Why does python break IEEE 754 for 1.0/0.0 and 0.0/0.0?
    ... >> Note that support for 754 was rare on Python platforms at the ... > production and handling of infinities and NaNs) for more than ...
    (comp.lang.python)
  • Re: Need a compelling argument to use Django instead of Rails
    ... In my case, multimedia and game support is patchy, ... There are lots of multimedia and game frameworks for Python. ...
    (comp.lang.python)