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


Groups > comp.lang.python > #9582

Re: Python threading/multiprocessing issue.

References <SNT106-W28C92B220F97ABFE97E73CB1490@phx.gbl>
Date 2011-07-16 09:34 +1000
Subject Re: Python threading/multiprocessing issue.
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1089.1310772884.1164.python-list@python.org> (permalink)

Show all headers | View raw


2011/7/16 Lee Harr <missive@hotmail.com>:
> I am not a multiprocessing expert, but I think the problem you
> are having is that Process is running your code in a separate
> process, so there is no way you could see those object changes
> in your main line code.
>
> In other words, Process is not an exact replacement for Thread.
>

That's correct; inter-process communication is the realm of sockets
(network or Unix), pipes, signals, etc - but inter-thread
communication is a matter of making sure you don't tread on each
other's toes. In CPython, the latter is guaranteed by the GIL; the
specific advantage of multiprocessing over threading is that each
process has a separate GIL, and that's because all variables are
separate.

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 09:34 +1000

csiph-web