Hacker News new | ask | show | jobs
by ShabbyDoo 5999 days ago
Knowing little of Python, is it the case that the GIL was not initially deemed a bad scheme because multi-processor x86 machines were a rarity in the mid-90's (when Python was young)? I presume that Sun desired Java to be multiprocessor friendly because it had multi-cpu SPARC machines at the time of Java's design?

And, for those using Python for high-volume production systems, how do you cope? Do you run one process (say a Zope instance) per core and load balance?

2 comments

Keep in mind the GIL is only a problem when you a) use threads and b) perform CPU-bound operations (unless you need soft real time)

When writing CPU-bound code, there are many libraries like NumPy that can do your heavy lifting in native code (thus avoiding the GIL)

So it really isn't as bad as it seems. The reason this patch is good, is because it prevents performance from falling apart if one of your threads takes up too much CPU.

Yep, a process per core.

The beauty is that since your app has to be written to be multiprocess capable then you can also extend past one computer when the need arises.

You pay a memory tax overhead though.