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


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

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

Started byDevin Jeanpierre <jeanpierreda@gmail.com>
First post2015-01-28 12:50 -0800
Last post2015-01-28 12:50 -0800
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: multiprocessing module backport from 3 to 2.7 - spawn feature Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-01-28 12:50 -0800

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

FromDevin Jeanpierre <jeanpierreda@gmail.com>
Date2015-01-28 12:50 -0800
SubjectRe: multiprocessing module backport from 3 to 2.7 - spawn feature
Message-ID<mailman.18237.1422478293.18130.python-list@python.org>
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

[toc] | [standalone]


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


csiph-web