Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

A horse! A horse! My kingdom for a horse! -- Wm. Shakespeare, "Richard III"


comp / comp.lang.python / Re: python C-api and thread

SubjectAuthor
* python C-api and threadaotto1968
+* Re: python C-api and thread (Posting On Python-List Prohibited)Lawrence D'Oliveiro
|`- Re: python C-api and thread (Posting On Python-List Prohibited)aotto1968
+* Re: python C-api and threadGrant Edwards
|`* Re: python C-api and threadaotto1968
| +- Re: python C-api and threadBarry Scott
| `- Re: python C-api and thread (Posting On Python-List Prohibited)Lawrence D'Oliveiro
`- Re: python C-api and threadChris Angelico

1
Subject: python C-api and thread
From: aotto1968
Newsgroups: comp.lang.python
Organization: A noiseless patient Spider
Date: Mon, 5 Aug 2024 21:19 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: aotto1968@t-online.de (aotto1968)
Newsgroups: comp.lang.python
Subject: python C-api and thread
Date: Mon, 5 Aug 2024 23:19:14 +0200
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <v8rfki$13c5s$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 05 Aug 2024 23:19:15 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="5b74f0766eb4855787291fd013e7df12";
logging-data="1159356"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19BIh9//VEhM/K+kyKl0Uhhf8nb7BOVgGE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:2I/+ujfyntA39oL1zK5vYDh+e7Q=
Content-Language: en-US
View all headers

hi,

Is it possible to run two completely independent Python interpreters in one process, each using a thread?

By independent, I mean that no data is shared between the interpreters and thus the C API can be used without any other
"lock/GIL" etc.

mfg

Subject: Re: python C-api and thread (Posting On Python-List Prohibited)
From: Lawrence D'Oliv
Newsgroups: comp.lang.python
Organization: A noiseless patient Spider
Date: Tue, 6 Aug 2024 00:32 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.python
Subject: Re: python C-api and thread (Posting On Python-List Prohibited)
Date: Tue, 6 Aug 2024 00:32:49 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <v8rqvg$16a8l$3@dont-email.me>
References: <v8rfki$13c5s$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 06 Aug 2024 02:32:49 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="6e0317a773c6dba529c5a1af356cf75e";
logging-data="1255701"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Aw9BSlLcWohjoeCwwEhj2"
User-Agent: Pan/0.159 (Vovchansk; )
Cancel-Lock: sha1:RfXfl8dvmzMw72Y79NxmBZWMoac=
View all headers

On Mon, 5 Aug 2024 23:19:14 +0200, aotto1968 wrote:

> Is it possible to run two completely independent Python interpreters in
> one process, each using a thread?
>
> By independent, I mean that no data is shared between the interpreters
> and thus the C API can be used without any other "lock/GIL" etc.

Seems like yes
<https://docs.python.org/3/c-api/init.html#c.Py_NewInterpreterFromConfig>.

Subject: Re: python C-api and thread
From: Grant Edwards
Newsgroups: comp.lang.python
Date: Tue, 6 Aug 2024 02:34 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: grant.b.edwards@gmail.com (Grant Edwards)
Newsgroups: comp.lang.python
Subject: Re: python C-api and thread
Date: Mon, 05 Aug 2024 22:34:05 -0400 (EDT)
Lines: 21
Message-ID: <mailman.21.1722911646.2890.python-list@python.org>
References: <v8rfki$13c5s$1@dont-email.me>
<4WdHSF10ZRznWJR@mail.python.org>
X-Trace: news.uni-berlin.de SQa+AZJycnyAJDS7E08g6AI4FjX1a2izE4I7AMKpY4Ww==
Cancel-Lock: sha1:111bNG/nggmpKiwI2EKyqkSXFHo= sha256:q0RBidVBOFfdDs1wcd4TtpEPBcuGMCaJp87FIt8ZqYo=
Return-Path: <grant.b.edwards@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.103
X-Spam-Level: *
X-Spam-Evidence: '*H*': 0.79; '*S*': 0.00; 'subject:python': 0.06;
'from:addr:grant.b.edwards': 0.16; 'from:name:grant edwards':
0.16; 'independent,': 0.16; 'seen.': 0.16; 'subject:thread': 0.16;
'wrote:': 0.16; 'python': 0.16; 'api': 0.17; 'grant': 0.17;
'to:addr:python-list': 0.20; "i've": 0.22; 'run': 0.23; 'header
:User-Agent:1': 0.30; 'python-list': 0.32; 'mean': 0.34; 'trying':
0.35; 'usual': 0.35; 'from:addr:gmail.com': 0.35; 'processes':
0.36; 'using': 0.37; 'two': 0.39; 'shared': 0.39; 'data.': 0.40;
'data,': 0.63; 'ever': 0.63; 'between': 0.63; 'share': 0.63;
'definition': 0.64; 'thus': 0.64; 'independent': 0.65; 'message-
id:invalid': 0.68; 'exactly': 0.68; 'process,': 0.75;
'interpreters': 0.84
User-Agent: slrn/1.0.3 (Linux)
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: <4WdHSF10ZRznWJR@mail.python.org>
X-Mailman-Original-References: <v8rfki$13c5s$1@dont-email.me>
View all headers

On 2024-08-05, aotto1968 via Python-list <python-list@python.org> wrote:

> Is it possible to run two completely independent Python interpreters
> in one process, each using a thread?
>
> By independent, I mean that no data is shared between the
> interpreters and thus the C API can be used without any other
> "lock/GIL" etc.

No, not using any OS I've ever seen. The usual definition of "threads"
is that they share data, and the definition of "processes" is that
processes don't share data.

How exactly does what you're trying to do differ from runnig two
Python interpreters in two processes?

--
Grant

Subject: Re: python C-api and thread
From: Chris Angelico
Newsgroups: comp.lang.python
Date: Tue, 6 Aug 2024 02:40 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: rosuav@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: python C-api and thread
Date: Tue, 6 Aug 2024 12:40:18 +1000
Lines: 16
Message-ID: <mailman.22.1722912033.2890.python-list@python.org>
References: <v8rfki$13c5s$1@dont-email.me>
<CAPTjJmpeXy3NBAqy53xjTHZKiut7i1GzW2re1anfNayHaLacZg@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de cUS5Fr3BSz+eTwDToq1rXwiphZkywofY+kQNvYKdd3AQ==
Cancel-Lock: sha1:FTqmYAJA4ofaDQJxATHJifhdeX8= sha256:1Z4YvVYllOtIog8cU24mnY1nEA7qxUPzVR0J8CCyGK0=
Return-Path: <rosuav@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=YKUBzi7s;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.002
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:python': 0.06;
'aug': 0.07; 'cc:addr:python-list': 0.09; 'url-
ip:151.101.0.223/32': 0.09; 'url-ip:151.101.128.223/32': 0.09;
'url-ip:151.101.192.223/32': 0.09; 'url-ip:151.101.64.223/32':
0.09; 'cc:no real name:2**0': 0.14; '2024': 0.16; 'chrisa': 0.16;
'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
'independent,': 0.16; 'received:mail-lf1-x131.google.com': 0.16;
'subject:thread': 0.16; 'url:peps': 0.16; 'wrote:': 0.16;
'python': 0.16; 'api': 0.17; 'probably': 0.17; 'tue,': 0.19;
'cc:addr:python.org': 0.20; 'run': 0.23; 'cc:2**0': 0.25;
'thinking': 0.28; 'python-list': 0.32; 'message-
id:@mail.gmail.com': 0.32; 'mean': 0.34; 'header:In-Reply-To:1':
0.34; 'received:google.com': 0.34; 'from:addr:gmail.com': 0.35;
'using': 0.37; 'two': 0.39; 'shared': 0.39; 'url-ip:151.101.0/24':
0.62; 'url-ip:151.101.128/24': 0.62; 'url-ip:151.101.192/24':
0.62; 'url-ip:151.101.64/24': 0.62; 'between': 0.63; 'thus': 0.64;
'independent': 0.65; 'process,': 0.75; 'interpreters': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1722912031; x=1723516831; darn=python.org;
h=cc:to:subject:message-id:date:from:in-reply-to:references
:mime-version:from:to:cc:subject:date:message-id:reply-to;
bh=X0V2n2j7R8FvqFb80NgBHz5QWmQFl/4TrzeBsDDsc9o=;
b=YKUBzi7s66sedGckw/c0Xtyq/CBKvDobHZ48fuNNTVfhmHcBZyNRXV6n7a3erZKQbL
NTjK6YskzgOaUt3uVTGIEloncUV2jxqwf6hOWUPDL8cb93OTUjAmRX8Nwcluz4Ar1PU2
FXU+uN3TNG2Uv+L5O1FucyfgRoLxcP4RLwu+WBUxRp+xkNOLTh3VNjXODRwAcmFxLgy7
ZcQq1Zglb1S9VQhWuEhJpJe06MNOA3Y53WXK3MC/MOXeilrq6xe3mmt0yLdd8jQkvlTg
TdukwXldUxw6tGbWQtXyIQeVXGG3GBp+sc/jaeU2pCegua0tB+Bp/amU/6a0tXeBHFri
0PBg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1722912031; x=1723516831;
h=cc:to:subject:message-id:date:from:in-reply-to:references
:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=X0V2n2j7R8FvqFb80NgBHz5QWmQFl/4TrzeBsDDsc9o=;
b=MNg5QYCQ/8D5eMX5a1wIUB2AvX8QohINtfxmmtgCDFsxz+vSPBiF6eWQ68ZOxzXSSS
9TE8xlmvssy9+CM/Dj0oBMV+4RNcHozIqEyp2NDvJePVDYyG+OM+Y9V1s1hZ9VG5DjJY
u0egn0jjCCwHaf8cGOvPPyYOmzs5LaK4Ki6tLJ6m26apjg65MsPxF1WeeTYqKskQBgcu
8fESlsWcmwe/ad6492B4SPsZ3ptAj9wEoQlTA0c/HU8vlAa8W6PY3GYV5He1uBEQAp+w
TovvLzVnhcc6ngiv9P1PqhG7sBMTdWrSk2s/KEqSVC4SRx9cN9XVHr4PGrnPa3hv7P3n
H0KQ==
X-Gm-Message-State: AOJu0Yyy0m4RQzXgJretYtDpfOtn2GLqooU57hSy86ugC3Px6fxqyXv2
eJYG+jI+1x7RYC0lSsDzb2ySrSN4uLOEz9bYbwEEIHec47XpBAVpZkoFYAucBQOIgusYFKBcWJF
6nmlzvb5caRpeyzB6HwBcCcp7fegsLR5i
X-Google-Smtp-Source: AGHT+IE0deVHg3+1xZJFnZWV4ZGFHmYtIvQFzrBUnAA0017QjirG51jQnsMYqTlE5XmmES62fEo3sVh4EzTzJH+lXqc=
X-Received: by 2002:a05:6512:acf:b0:52e:9b2f:c313 with SMTP id
2adb3069b0e04-530bb3781famr9332097e87.22.1722912030103; Mon, 05 Aug 2024
19:40:30 -0700 (PDT)
In-Reply-To: <v8rfki$13c5s$1@dont-email.me>
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: <CAPTjJmpeXy3NBAqy53xjTHZKiut7i1GzW2re1anfNayHaLacZg@mail.gmail.com>
X-Mailman-Original-References: <v8rfki$13c5s$1@dont-email.me>
View all headers

On Tue, 6 Aug 2024 at 08:48, aotto1968 via Python-list
<python-list@python.org> wrote:
>
> hi,
>
> Is it possible to run two completely independent Python interpreters in one process, each using a thread?
>
> By independent, I mean that no data is shared between the interpreters and thus the C API can be used without any other
> "lock/GIL" etc.
>

You're probably thinking of subinterpreters:

https://peps.python.org/pep-0734/

ChrisA

Subject: Re: python C-api and thread (Posting On Python-List Prohibited)
From: aotto1968
Newsgroups: comp.lang.python
Organization: A noiseless patient Spider
Date: Tue, 6 Aug 2024 06:01 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: aotto1968@t-online.de (aotto1968)
Newsgroups: comp.lang.python
Subject: Re: python C-api and thread (Posting On Python-List Prohibited)
Date: Tue, 6 Aug 2024 08:01:41 +0200
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <v8se85$1daq2$1@dont-email.me>
References: <v8rfki$13c5s$1@dont-email.me> <v8rqvg$16a8l$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 06 Aug 2024 08:01:42 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="025088cc8906f7a327204dc6f63a9fcf";
logging-data="1485634"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Y+/Ijc1fJCzA66z9t2C4yEJ8q+c4H8RY="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:AiF3gHdHFN/8zCFHPPUYtmyetII=
In-Reply-To: <v8rqvg$16a8l$3@dont-email.me>
Content-Language: en-US
View all headers

On 06.08.24 02:32, Lawrence D'Oliveiro wrote:
> On Mon, 5 Aug 2024 23:19:14 +0200, aotto1968 wrote:
>
>> Is it possible to run two completely independent Python interpreters in
>> one process, each using a thread?
>>
>> By independent, I mean that no data is shared between the interpreters
>> and thus the C API can be used without any other "lock/GIL" etc.
>
> Seems like yes
> <https://docs.python.org/3/c-api/init.html#c.Py_NewInterpreterFromConfig>.

→ I think that could be a solution.

Subject: Re: python C-api and thread
From: aotto1968
Newsgroups: comp.lang.python
Organization: A noiseless patient Spider
Date: Tue, 6 Aug 2024 06:11 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: aotto1968@t-online.de (aotto1968)
Newsgroups: comp.lang.python
Subject: Re: python C-api and thread
Date: Tue, 6 Aug 2024 08:11:39 +0200
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <v8seqr$1daq2$2@dont-email.me>
References: <v8rfki$13c5s$1@dont-email.me> <4WdHSF10ZRznWJR@mail.python.org>
<mailman.21.1722911646.2890.python-list@python.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 06 Aug 2024 08:11:40 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="025088cc8906f7a327204dc6f63a9fcf";
logging-data="1485634"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+WPp64dLtOqcAgphcM7kTFQLMblL8AVBw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:GrLMOaUMVQ6V8pN/hnjlibFPhP0=
In-Reply-To: <mailman.21.1722911646.2890.python-list@python.org>
Content-Language: en-US
View all headers

On 06.08.24 04:34, Grant Edwards wrote:
> On 2024-08-05, aotto1968 via Python-list <python-list@python.org> wrote:
>
>> Is it possible to run two completely independent Python interpreters
>> in one process, each using a thread?
>>
>> By independent, I mean that no data is shared between the
>> interpreters and thus the C API can be used without any other
>> "lock/GIL" etc.
>
> No, not using any OS I've ever seen. The usual definition of "threads"
> is that they share data, and the definition of "processes" is that
> processes don't share data.
>
> How exactly does what you're trying to do differ from runnig two
> Python interpreters in two processes?
>
> --
> Grant
>
>
>

I know but I use a thread like a process because the "conversation" between the threads is done by my
software. a Thread is usually faster to startup (thread-pool) this mean for high-load this is
significant faster even than fork.

Subject: Re: python C-api and thread
From: Barry Scott
Newsgroups: comp.lang.python
Date: Tue, 6 Aug 2024 20:12 UTC
References: 1 2 3 4 5
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: barry@barrys-emacs.org (Barry Scott)
Newsgroups: comp.lang.python
Subject: Re: python C-api and thread
Date: Tue, 6 Aug 2024 21:12:46 +0100
Lines: 17
Message-ID: <mailman.27.1722975171.2890.python-list@python.org>
References: <v8rfki$13c5s$1@dont-email.me> <4WdHSF10ZRznWJR@mail.python.org>
<mailman.21.1722911646.2890.python-list@python.org>
<v8seqr$1daq2$2@dont-email.me>
<F7D00EF5-BCAA-4645-82ED-64949BE2168C@barrys-emacs.org>
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\))
Content-Type: text/plain;
charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de pkfTivuAonCQvXffsbCZ2wYHD8GPP5yxAdAUNS9xjtjQ==
Cancel-Lock: sha1:JNo3186gUPa5mmGY0sj3DkE8hDs= sha256:Innia6y0qVhvFhbbN+OLtUGN8mLlxsp6vIarAL0JG0M=
Return-Path: <barry@barrys-emacs.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.023
X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'thread': 0.05;
'subject:python': 0.06; 'aug': 0.07; 'cc:addr:python-list': 0.09;
'from:addr:barry': 0.09; 'received:gandi.net': 0.09;
'received:mail.gandi.net': 0.09; 'threads': 0.09; 'cc:no real
name:2**0': 0.14; 'assuming': 0.16; 'barry': 0.16; 'from:addr
:barrys-emacs.org': 0.16; 'from:name:barry scott': 0.16; 'message-
id:@barrys-emacs.org': 0.16; 'subject:thread': 0.16;
'wrote:<span': 0.16; 'wrote:': 0.16; 'cc:addr:python.org': 0.20;
'cc:2**0': 0.25; 'perform': 0.26; 'done': 0.28; 'email
addr:python.org&gt;': 0.28; 'python-list': 0.32; 'but': 0.32;
'0);': 0.33; 'rgb(0,': 0.33; 'mean': 0.34; 'header:In-Reply-To:1':
0.34; 'processes': 0.36; 'using': 0.37; 'means': 0.38; 'enough':
0.39; 'use': 0.39; 'font-family:': 0.60; 'inline': 0.61;
'display:': 0.62; 'none;': 0.62; 'font-weight:': 0.62; '0px;':
0.63; 'between': 0.63; 'text-indent:': 0.64; 'normal;': 0.66;
'skip:! 10': 0.67; 'float:': 0.74; 'significant': 0.78; 'skip:!
20': 0.81; 'email name:&lt;python-list': 0.84; '400;': 0.89;
'13px;': 0.91
In-Reply-To: <v8seqr$1daq2$2@dont-email.me>
X-Mailer: Apple Mail (2.3776.700.51)
X-GND-Sasl: barry@barrys-emacs.org
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
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: <F7D00EF5-BCAA-4645-82ED-64949BE2168C@barrys-emacs.org>
X-Mailman-Original-References: <v8rfki$13c5s$1@dont-email.me>
<4WdHSF10ZRznWJR@mail.python.org>
<mailman.21.1722911646.2890.python-list@python.org>
<v8seqr$1daq2$2@dont-email.me>
View all headers

> On 6 Aug 2024, at 07:11, aotto1968 via Python-list <python-list@python.org> wrote:
>
> I know but I use a thread like a process because the "conversation" between the threads is done by my
> software. a Thread is usually faster to startup (thread-pool) this mean for high-load this is
> significant faster even than fork.

using processes means you are more robust and can survive a process crash.
using async, assuming you do enough I/O, will out perform threads.

Barry

Subject: Re: python C-api and thread (Posting On Python-List Prohibited)
From: Lawrence D'Oliv
Newsgroups: comp.lang.python
Organization: A noiseless patient Spider
Date: Tue, 6 Aug 2024 23:41 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.python
Subject: Re: python C-api and thread (Posting On Python-List Prohibited)
Date: Tue, 6 Aug 2024 23:41:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 5
Message-ID: <v8ucbo$1u86k$5@dont-email.me>
References: <v8rfki$13c5s$1@dont-email.me> <4WdHSF10ZRznWJR@mail.python.org>
<mailman.21.1722911646.2890.python-list@python.org>
<v8seqr$1daq2$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 07 Aug 2024 01:41:45 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="8e0bcc1e6c667f299b1c29714d183294";
logging-data="2040020"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/CUluJUzmWiFMxgGp+3H9v"
User-Agent: Pan/0.159 (Vovchansk; )
Cancel-Lock: sha1:aXu7S5DGh/xdq+k7AxPTRBolXL0=
View all headers

On Tue, 6 Aug 2024 08:11:39 +0200, aotto1968 wrote:

> ... a Thread is usually faster to startup (thread-pool) ...

Process pools exist, too. As I recall, Apache and Android use them.

1

rocksolid light 0.9.8
clearnet tor