[Python-Dev] Making python C-API thread safe (try 2)

Daniel Dittmar daniel.dittmar at sap.com
Wed Sep 17 09:43:31 EDT 2003


Jeff Epler wrote:
> Keep in mind that probably more than of 99.9% of machines out there
> have only one CPU anyway

This could very well change in the future and is probably quite different in
the server segment. Although if I had 2 CPUs on my desktop, I'd prefer it if
a CPU hog blocks only one of them, so Python would be perfect for that
scenario.

> no-ops, and use fork() to get that 2%* performance increase.

Keep in mind that probably more than <wild guess> of machines out there use
windows, so fork () is not an option.

But the real problem with free threading are the reference counters as they
have to be protected from concurrent accesses, which is now done cheaply by
relying on the GIL.

So my guess is that a free threading Python will be slower, even when no
threads are used.

Daniel







More information about the Python-list mailing list