470,591 Members | 1,483 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,591 developers. It's quick & easy.

multi-CPU, GIL, threading on linux


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:

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?

Jul 19 '05 #1
0 930

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Frank Jona | last post: by
5 posts views Thread by bobwansink | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.