Sujet : Re: python C-api and thread
De : aotto1968 (at) *nospam* t-online.de (aotto1968)
Groupes : comp.lang.pythonDate : 06. Aug 2024, 08:11:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v8seqr$1daq2$2@dont-email.me>
References : 1 2 3
User-Agent : Mozilla Thunderbird
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 mysoftware. a Thread is usually faster to startup (thread-pool) this mean for high-load this issignificant faster even than fork.