[AMD64-SMP] I can't get my cpus working at 100%

Andrew MacIntyre andymac at bullseye.apana.org.au
Sat Aug 26 03:42:17 UTC 2006


Christian Walther wrote:

> A nice example of a program being able to do threading, but one CPU
> (core) only is python.

This is not strictly correct: Python relies on a global interpreter lock
(aka GIL) to protect internal data structures.  When code in the Python
process doesn't require access to these data structures, threads can run 
outside the influence of the lock and run simultaneously on multiple
CPUs.  Python's I/O system (eg file/network I/O) and many Python
extensions do exactly this.

-- 
-------------------------------------------------------------------------
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andymac at bullseye.apana.org.au  (pref) | Snail: PO Box 370
        andymac at pcug.org.au             (alt) |        Belconnen ACT 2616
Web:    http://www.andymac.org/               |        Australia


More information about the freebsd-stable mailing list