Secondary Concurrency Model: Subinterpreter Support #220
Labels
No labels
Alpha Release Requirement
Bugfix
Demo Target
Documentation
Major Feature
Minor Feature
priority:tier1-active
priority:tier2-foundation
priority:tier3-future
priority:tier4-deferred
Refactoring & Cleanup
system:animation
system:documentation
system:grid
system:input
system:performance
system:procgen
system:python-binding
system:rendering
system:ui-hierarchy
Tiny Feature
workflow:blocked
workflow:needs-benchmark
workflow:needs-documentation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Depends on
#219 Primary Concurrency Model: Threading Support with mcrfpy.lock()
john/McRogueFace
Reference
john/McRogueFace#220
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Secondary Concurrency Model: Subinterpreters
Enable isolated Python subinterpreters for advanced concurrency scenarios with true parallelism (separate GILs in Python 3.12+).
Motivation
While the primary threading model (see related issue) handles most use cases, subinterpreters provide:
Design
Command Line Interface
The subinterpreter starts automatically but user code manages its own threading/event loop.
mcrfpy.Queue- Cross-Interpreter CommunicationThread-safe, subinterpreter-safe queue for bytes. Named queues are accessible from any interpreter.
mcrfpy.lock()Across SubinterpretersSame primitive as primary model, but coordinates across all interpreters:
Implementation
C++ Queue
Subinterpreter Lifecycle
Limitations
Derived Types Cannot Cross Interpreter Boundaries
Workaround: Use
mcrfpy.Queuefor data that requires derived type access. Main interpreter processes requests with full type access.Separate Module State
Each subinterpreter imports
mcrfpyseparately:Implementation Tasks
mcrfpy.Queuewith named registry--exec-subinterpretercommand line argumentmcrfpy.lock()for cross-interpreter coordinationmcrfpy.Scene.find(name)for accessing existing scenesDependencies
Future Considerations