[Python-Dev] Re: marking shared-ness

Greg Stein gstein@lyra.org
Fri, 21 Apr 2000 12:52:06 -0700 (PDT)


On Fri, 21 Apr 2000, Christian Tismer wrote:
>...
> > No. Now you're just talking processes with IPC. Yes, they happen to run in
> > threads, but you got none of the advantages of a threaded application.
> 
> Are you shure that every thread user shares your opinion?

Now you're just being argumentative. I won't respond to this.

>...
> Other languages have much fewer problems here (I mean
> C, C++, Delphi...), they are able to do the right thing
> in the right place.
> Python is not designed for that. Why do you want to enforce
> the impossible, letting every object pay a high penalty
> to become completely thread-safe?

Existing Python semantics plus free-threading places us in this scenario.
Many people have asked for free-threading, and the number of inquiries
that I receive have grown over time. (nobody asked in 1996 when I first
published my patches; I get a query every couple months now)

>...
> You know that I like to optimize things. For me, optimization
> mut give an overall gain, not just in one area, where others
> get worse. If free threading cannot be optimized in
> a way that gives better overall performance, then
> it is a wrong optimization to me.
> 
> Well, this is all speculative until we did some measures.
> Maybe I'm just complaining about 1-2 percent of performance
> loss, then I'd agree to move my complaining into /dev/null :-)

It is more than this. In my last shot at this, pystone ran about half as
fast. There are a few things that will be different this time around, but
it certainly won't in the "few percent" range.

Presuming you can keep your lock contention low, then your overall
performances *goes up* once you have a multiprocessor machine. Sure, each
processor runs Python (say) 10% slower, but you have *two* of them going.
That is 180% compared to a central-lock Python on an MP machine.

Lock contention: my last patches had really high contention. It didn't
scale across processors well. This round will have more fine-grained locks
than the previous version. But it will be interesting to measure the
contention.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/