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


Groups > comp.lang.python > #84783

Re: multiprocessing module backport from 3 to 2.7 - spawn feature

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <jeanpierreda@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'broken': 0.04; 'resulting': 0.04; 'yet.': 0.04; 'andres': 0.09; 'feature,': 0.09; 'subject:2.7': 0.09; 'subject:module': 0.09; 'worse': 0.09; 'cc:addr:python-list': 0.11; 'jan': 0.12; 'systems.': 0.12; '2.7': 0.14; 'windows': 0.15; 'fork': 0.16; 'spawn': 0.16; 'subject:skip:m 10': 0.16; 'unix,': 0.16; 'wrote:': 0.18; 'obviously': 0.18; 'wed,': 0.18; '(in': 0.22; 'cc:addr:gmail.com': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**1': 0.23; 'adds': 0.24; 'lets': 0.24; 'skip': 0.24; "haven't": 0.24; 'specially': 0.26; 'header:In-Reply-To:1': 0.27; 'feature': 0.29; '[1]': 0.29; 'am,': 0.29; 'unix': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; '3.x': 0.31; 'option.': 0.31; 'subject:from': 0.34; 'one,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'version': 0.36; 'leads': 0.36; 'module.': 0.36; 'too': 0.37; 'two': 0.37; 'anything': 0.39; 'ability': 0.39; 'explain': 0.39; 'enough': 0.39; 'such': 0.63; 'different': 0.65; 'to:addr:gmail.com': 0.65; 'between': 0.67; '2015': 0.84; 'viable': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=3Bgge2Ysh0kjA550M+55Nnpchbq7ImqGPD4pNba29Xg=; b=UWIyPJTkfAtSaB2b5oiMxEpoJ34DJeCStA5vpXtp9s9pG1c8G4l6K2fWn7JjGaCejD Spa9UokkFN5QWkbpzc448euQk2nUxXmNzuROspmQR5TvHm4b7lp/5KEOTVVqs+IaSbSy 4a8Dfgu2ZpPiOOituJCeMgHlKZhcKoZtU6tx4zmPTsy4eWnNTfOhfH9hSt1L7KQ4Lv9S vjujxXBWJUvoNi+J61xgFokgBob3OqsOwDFjRjGuyQnH4qGlSW7j/MaSaNeaRR937jxL g0THvllfMzAiz1VXu8fGPQ+apzYmwYJmqZz32wuJlvoyr66bNhfFy0YkterOSzvDKhPM Rqsw==
X-Received by 10.229.37.136 with SMTP id x8mr15173203qcd.30.1422478290912; Wed, 28 Jan 2015 12:51:30 -0800 (PST)
MIME-Version 1.0
In-Reply-To <CANc-5UyZZNkTjrVUt1M2zAUCeJGr_RffXcO_E4FiY5gZhSOD1A@mail.gmail.com>
References <CA+1Rt66fb5zFwKiBG=tkHzURfiYFX_xKo=XxUKvWO4CdySX0_Q@mail.gmail.com> <CANc-5UyZZNkTjrVUt1M2zAUCeJGr_RffXcO_E4FiY5gZhSOD1A@mail.gmail.com>
From Devin Jeanpierre <jeanpierreda@gmail.com>
Date Wed, 28 Jan 2015 12:50:50 -0800
Subject Re: multiprocessing module backport from 3 to 2.7 - spawn feature
To Skip Montanaro <skip.montanaro@gmail.com>
Content-Type text/plain; charset=UTF-8
Cc Python <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.18237.1422478293.18130.python-list@python.org> (permalink)
Lines 23
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1422478293 news.xs4all.nl 2969 [2001:888:2000:d::a6]:34815
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:84783

Show key headers only | View raw


On Wed, Jan 28, 2015 at 10:06 AM, Skip Montanaro
<skip.montanaro@gmail.com> wrote:
> On Wed, Jan 28, 2015 at 7:07 AM, Andres Riancho <andres.riancho@gmail.com>
> wrote:
>> The feature I'm specially interested in is the ability to spawn
>> processes [1] instead of forking, which is not present in the 2.7
>> version of the module.
>
> Can you explain what you see as the difference between "spawn" and "fork" in
> this context? Are you using Windows perhaps? I don't know anything obviously
> different between the two terms on Unix systems.

On Unix, if you fork without exec*, and had threads open, threads
abruptly terminate, resulting in completely broken mutex state etc.,
which leads to deadlocks or worse if you try to acquire resources in
the forked child process. So in such circumstances, multiprocessing
(in 2.7) is not a viable option. But 3.x adds a feature, "spawn", that
lets you fork+exec instead of just forking.

I too would be interested in such a backport. I considered writing
one, but haven't had a strong enough need yet.

-- Devin

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


Thread

Re: multiprocessing module backport from 3 to 2.7 - spawn feature Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-01-28 12:50 -0800

csiph-web