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


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

Re: Global Variable In Multiprocessing

Started byChris Angelico <rosuav@gmail.com>
First post2013-10-23 17:44 +1100
Last post2013-10-23 17:44 +1100
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: Global Variable In Multiprocessing Chris Angelico <rosuav@gmail.com> - 2013-10-23 17:44 +1100

#57344 — Re: Global Variable In Multiprocessing

FromChris Angelico <rosuav@gmail.com>
Date2013-10-23 17:44 +1100
SubjectRe: Global Variable In Multiprocessing
Message-ID<mailman.1397.1382510683.18130.python-list@python.org>
On Wed, Oct 23, 2013 at 5:22 PM, Chandru Rajendran
<Chandru_Rajendran@infosys.com> wrote:
>
> I am newbie to python. Please give me an idea to use Global Variable In multiprocessing with examples. Also give me an best practices of multiprocessing.

Fundamentally, you can't have mutable globals in multiprocessing
(though you can have immutables - they'll get copied into each
subprocess). Instead, look into the various data structures like the
queue, which can transfer information from one process to another. The
best option depends a lot on what you're doing - but you can find some
tips and ideas in the multiprocessing module's documentation. (You
HAVE read the docs already, right? :) )

ChrisA

[toc] | [standalone]


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


csiph-web