Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

People are going to scream bloody murder about that. -- Seen on linux-kernel


devel / comp.lang.python / Re: Execute in a multiprocessing child dynamic code loaded by the parent process

SubjectAuthor
o Re: Execute in a multiprocessing child dynamic code loaded by theMartin Di Paola

1
Re: Execute in a multiprocessing child dynamic code loaded by the parent process

<mailman.217.1646599356.2329.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17406&group=comp.lang.python#17406

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: martinp....@gmail.com (Martin Di Paola)
Newsgroups: comp.lang.python
Subject: Re: Execute in a multiprocessing child dynamic code loaded by the
parent process
Date: Sun, 6 Mar 2022 20:42:28 +0000
Lines: 9
Message-ID: <mailman.217.1646599356.2329.python-list@python.org>
References: <20220306124208.orqbcezhqqeysdpe@gmail.com>
<25124.63881.205740.249595@ixdm.fritz.box>
<20220306204228.l5pzjzc6peytbshp@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
X-Trace: news.uni-berlin.de rDPip7buRgK41XayFPRv6QK7Slq9mZ3CV9PV9pJwKPfg==
Return-Path: <martinp.dipaola@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=P6XKUBjv;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.005
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'modules': 0.07; 'parent':
0.07; 'child': 0.09; 'macos': 0.09; '"start': 0.16; '(instead':
0.16; 'indeed': 0.16; 'ones.': 0.16; 'pickle': 0.16;
'subject:child': 0.16; 'subject:code': 0.16; 'subject:dynamic':
0.16; 'subject:parent': 0.16; 'subject:skip:m 10': 0.16;
'windows.': 0.16; 'problem': 0.16; 'message-id:@gmail.com': 0.18;
'to:addr:python-list': 0.20; 'to:name:python-list@python.org':
0.24; '(and': 0.25; 'default': 0.31; 'but': 0.32; 'there': 0.33;
'particular': 0.33; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'from:addr:gmail.com': 0.35;
'received:209.85': 0.37; 'received:209': 0.39; 'use': 0.39;
'including': 0.60; 'copy': 0.63; 'lead': 0.67; 'yes': 0.76;
'subject: \n ': 0.84; 'received:168': 0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=date:from:to:subject:message-id:mail-followup-to:'user-agent
:references:mime-version:content-disposition:in-reply-to;
bh=jytycy7d417ZAnCqE2wYcQYSDBLp7XSlS1CNmWV6m9w=;
b=P6XKUBjvOurPG2aa8H70PUzUMhuVq6IiLed+0Qgi4i8f2WbYswh+jkd5QD62BqxNI2
dSaoH8di1rHt632CBk4EvHl7QrtGNAHmq8D8e5wrIgU2AqU9kAS6GKQkV9eGizwR/Hxq
FUimilCG4VnZtNJW+ZABf2+xpavzcBUe8DJS8Rm/ssgKlb9Cs1iko9jlfoAZCL1ZqjNu
HHfm8aw6xOO2z8M8juRKkjstp6K+EH87o+8z4hcdTvD6LrBdlTQtvYYHzdalraRrQMEI
8U9eDUs66/hRFIGh3K+WF6GBbpHt/eA5SlnlIsCTj/fSAXjb/sgW0NIQlVZ6TmLDn69e
R3rQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to
:'user-agent:references:mime-version:content-disposition:in-reply-to;
bh=jytycy7d417ZAnCqE2wYcQYSDBLp7XSlS1CNmWV6m9w=;
b=3fk9SrZOkhnxl55SGJl64kZfukSPWYp9+e+MLsNpYLjjkFM0BZudnattYMwXo4Aces
TgYFejpGikowI2uObvapdfc2m0/wLbB/l6G79+PcDxIZN9Y7p+/liC6QbTxBH9OqZ6XJ
f+ulsCsiSePtcyZrnJpwUDFoKzHfHKKPDEts6P8oXCaHpevd16tLwPS9qMPVgZff1Igr
PB9yFUN1fEyAiqqoD9n0R3LeqBN6M6tVMecKhuDFCP/cNZN9kXeB7mzWFeQ1Y8fTt7Xe
QcRg1V8SuimTrwCuh1rjC5CUCFzAnGDPlsT4AO0G6d2KqVyR1aDFq5Tk0S+Tey+qKilq
taug==
X-Gm-Message-State: AOAM532vg6nzam5Il6uljy5by7RbhyPiu0oxHRPYRnyzmF6qeI3Mnn4/
QEV55RuTPb2XjYzq+nPvrgp1YYdsjYM=
X-Google-Smtp-Source: ABdhPJzmn/ELhOG07hC6RALuK7TI+U+EWvvgGgPWXl+DhuCN3FBcpyJmr6/8fkJE+aQLqmazW1PMOA==
X-Received: by 2002:a05:6808:3014:b0:2d9:4715:eaea with SMTP id
ay20-20020a056808301400b002d94715eaeamr5153110oib.169.1646599353279;
Sun, 06 Mar 2022 12:42:33 -0800 (PST)
Mail-Followup-To: "python-list@python.org" <python-list@python.org>
'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
Thunderbird/52.5.2 Lightning/5.4.5.2'
Content-Disposition: inline
In-Reply-To: <25124.63881.205740.249595@ixdm.fritz.box>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
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: <https://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>
X-Mailman-Original-Message-ID: <20220306204228.l5pzjzc6peytbshp@gmail.com>
X-Mailman-Original-References: <20220306124208.orqbcezhqqeysdpe@gmail.com>
<25124.63881.205740.249595@ixdm.fritz.box>
 by: Martin Di Paola - Sun, 6 Mar 2022 20:42 UTC

>Try to use `fork` as "start method" (instead of "spawn").

Yes but no. Indeed with `fork` there is no need to pickle anything. In
particular the child process will be a copy of the parent so it will
have all the modules loaded, including the dynamic ones. Perfect.

The problem is that `fork` is the default only in Linux. It works in
MacOS but it may lead to crashes if the parent process is multithreaded
(and the my is!) and `fork` does not work in Windows.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor