6 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
52
views
Reappending threads after starting them
I was just following a tutorial on the usage of subinterpreters in python 3.12 .
In the tutorial there is the following code snippet:
def run_in_threads(total: int = 10):
sub_interpreters = []
...
0
votes
1
answer
361
views
Are Python 3.12 subinterpreters multi-CPU?
Python 3.12 exposes the subinterpreter functionality: after starting the Python main.exe you can spawn multiple subinterpreter threads.
Questions:
As the subinterpreter threads run in the same ...
3
votes
1
answer
198
views
Python Import Module fails using C API if more than one subinterpreter import a module that imports some specific modules
I wrote a single-threaded C++ code using Python C APIs where I start two subinterpreters Sub1 and Sub2, then I load a module M with both.
If M imports certain modules (such as urllib.request or yaml), ...
0
votes
1
answer
789
views
ImportError with Numpy using Python/C 3.12 API subinterpreters
I'm attempting to run a python script that spawns a subinterpreter and a main interpreter, each responsible for doing some sort of work (Based on the example used in this article). The work I'm having ...
0
votes
1
answer
353
views
Multithreading vs linear execution of python code showing absurd results
To my best knowledge if I have a CPU intensive work multithreading should work similar to linear execution of the same code. So I tested it using this simple code.
import datetime
import threading
...
29
votes
3
answers
13k
views
Python multi-thread multi-interpreter C API
I'm playing around with the C API for Python, but it is quite difficult to understand some corner cases. I could test it, but it seems a bug-prone and time consuming. So I come here to see if somebody ...