|
|
|
|
|
by rkeene2
1904 days ago
|
|
This is basically how the Threads extension [0] works for Tcl. Tcl has long supported creating many interpreters per thread. The Thread extension exposes some threading commands to the interpreter, which lets you create a new thread+interp. You can then send messages to that interpreter, or pass it file descriptors, but otherwise they are fairly isolated (apartment threading model). [0] https://www.tcl-lang.org/man/tcl8.6/ThreadCmd/thread.htm |
|
Encapsulated interpreter state via HPyContext would allow replacing the per-process lock with a per-interpreter lock, enabling such parallelism.