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


Groups > comp.lang.python > #9600

Re: Python threading/multiprocessing issue.

References <SNT106-W28C92B220F97ABFE97E73CB1490@phx.gbl> <CAPTjJmoHWOgbt_cHwtbOm7w9Mz8uJGaK+tCfd54y-psxd-4A9w@mail.gmail.com> <ivr6p0$uv1$1@dough.gmane.org>
Date 2011-07-16 15:19 +1000
Subject Re: Python threading/multiprocessing issue.
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1101.1310793564.1164.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web