Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #9600 > unrolled thread

Re: Python threading/multiprocessing issue.

Started byChris Angelico <rosuav@gmail.com>
First post2011-07-16 15:19 +1000
Last post2011-07-16 15:19 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Python threading/multiprocessing issue. Chris Angelico <rosuav@gmail.com> - 2011-07-16 15:19 +1000

#9600 — Re: Python threading/multiprocessing issue.

FromChris Angelico <rosuav@gmail.com>
Date2011-07-16 15:19 +1000
SubjectRe: Python threading/multiprocessing issue.
Message-ID<mailman.1101.1310793564.1164.python-list@python.org>
On Sat, Jul 16, 2011 at 3:15 PM, Dennis Lee Bieber
<wlfraed@ix.netcom.com> wrote:
> And (so far as I understand it) each process can claim its own CPU
> core, whereas threads share the active core.

Threads can be put onto separate cores too, and can have their
affinities set. But because of the GIL, actual CPython code can't run
on two cores at once. You might be able to have two Python threads
running at once if they're calling into C modules most of the time,
but it's much safer to either go multiprocessing or to use I/O bound
threads (eg socket handlers).

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web