Dedicated CPU core for Python?

sjdevnull at yahoo.com sjdevnull at yahoo.com
Fri Apr 27 19:03:23 EDT 2007


On Apr 27, 3:14 pm, "Joshua J. Kugler" <jos... at eeinternet.com> wrote:
> On Thursday 26 April 2007 14:07, Gabriel Genellina wrote:
>
> > En Thu, 26 Apr 2007 15:54:38 -0300, Joshua J. Kugler
> > <jos... at eeinternet.com> escribió:
>
> >> Are you talking about CPU affinity
> >> (http://en.wikipedia.org/wiki/Processor_affinity) or an actual CPU that
> >> can directory execute Python byte code?  If the former, CPython only
> >> uses one
> >> CPU core right now because it's threads are all internal, and do not
> >> spawn system threads (IIRC).
>
> > Python threads are OS threads:
> >http://docs.python.org/lib/module-thread.html
> > "[The thread module] is supported on Windows, Linux, SGI IRIX, Solaris
> > 2.x, as well as on systems that have a POSIX thread (a.k.a. ``pthread'')
> > implementation."
>
> Yes, that may be, but they are not true system threads, or at least do not
> appear to be.  Threads on linux each show up as a separate process.

No they don't, they used to with LinuxThreads but with newer kernels/
thread libraries/ps they no longer show up as processes.

Python threads are OS threads on Linux.  If you run strace on a simple
python program that generates a thread, you can see the clone() call.




More information about the Python-list mailing list