Running Python on SMP machine

Erno Kuusela erno-news at erno.iki.fi
Mon Oct 9 19:22:31 EDT 2000


>>>>> "Aahz" == Aahz Maruch <aahz at panix.com> writes:

 | That's the Global Interpreter Lock.  But my experience is that
 | frequently the overhead of synchronizing between two separate processes
 | overwhelms the payback you get from actual use of SMP -- that trick works
 | best if the two processes do no synchronization.

yes. that is true regardless of what ipc model (threads/locks or
message passing) you use.  some tasks are inherently not
parallelizable, while some tasks are.

this is, however, not a good reason to use python threads
for smp if your particular task is parallelizable. quite
the opposite.

 | Furthermore, it's not that hard to beat the GIL.  If any significant
 | amount of blocking I/O takes place, you'll benefit from threads.

possibly. but i would imagine most cases where people are asking
about taking advantage of smp, the task is not i/o bound.

 | [What I sometimes wonder is, how/why did *I* get to be the threading
 | champion on c.l.py?  It's not like I use threads very much, nor am I an
 | expert on them...  ;-)]

perhaps you should consider another job :)

  -- erno



More information about the Python-list mailing list