Path: ...!fu-berlin.de!uni-berlin.de!not-for-mail From: 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: References: <4WdHSF10ZRznWJR@mail.python.org> X-Trace: news.uni-berlin.de SQa+AZJycnyAJDS7E08g6AI4FjX1a2izE4I7AMKpY4Ww== Cancel-Lock: sha1:111bNG/nggmpKiwI2EKyqkSXFHo= sha256:q0RBidVBOFfdDs1wcd4TtpEPBcuGMCaJp87FIt8ZqYo= Return-Path: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <4WdHSF10ZRznWJR@mail.python.org> X-Mailman-Original-References: Bytes: 3042 On 2024-08-05, aotto1968 via Python-list 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