By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,035 Members | 1,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,035 IT Pros & Developers. It's quick & easy.

multi-CPU, GIL, threading on linux

P: n/a
hi,

as i understand, on linux, python uses the operating systems threads
(so python is not simulating threads by himself).

that means that on a multi-CPU computer, the different threads may get
executed on different CPUs.

i am working with zope, and i was referenced to this page:
http://www.zope.org/Members/glpb/solaris/report_ps

it's rather old (2002), but it claims the following:

I do *not* recommend running Zope on multiprocessor machines without an
ability to restrict Zope to execution on a single CPU.

The reason for this is that the Python Global Interpreter Lock is shared
inside a Zope process. However, threads in Python are backed by
underlying OS threads. Thus, Zope will create multiple threads, and
each thread is likely to be assigned to a different CPU by the OS
scheduler. However, all CPUs but one which are dispatching any given
Zope process will have to then wait and attempt to acquire the GIL; this
process introduces significant latency into Python and thus into Zope.


now, i know about tools that allow me to bind a python process to a
specific cpu, but i wonder..
is the performance soo bad when i am running a python process, and the
threads are running on different cpus?

i understand that because of the GIL i cannot make my application
faster. but slower?

thanks,
gabor
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.