Sub-interpreters inside rust side ( interpreter per runtime worker ) #5672
Unanswered
codingmstr
asked this question in
Questions
Replies: 1 comment
-
|
You should read #3451. The short answer is that PyO3 does not yet support subinterpreters well. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I created subinterpreters, one for each operator, but I'm having trouble using REST classes within these subinterpreteres. I always get the error: munmap_chunk(): invalid pointer
Aborted (core dumped) or the error: segment fault ,
code :
lib.rs ->
use pyo3::prelude::*;
pub mod core;
#[pymodule]
fn turbox( py: Python, m: &Bound<'_, PyModule> ) -> PyResult<()> {
}
workers. ->
use pyo3::prelude::*;
use pyo3::ffi;
use std::ptr;
use std::cell::RefCell;
use crate::core::route::Route;
use crate::core::server::Server;
thread_local! {
pub static WORKER_INTERPRETER_STATE: RefCell<*mut ffi::PyThreadState> = RefCell::new(ptr::null_mut());
}
pub fn build_module( py: Python<'>, m: &Bound<'_, PyModule> ) -> PyResult<()> {
}
pub fn ensure_sub_interpreter_initialized() {
}
I would appreciate it if you could tell me the correct way to do this successfully.
Beta Was this translation helpful? Give feedback.
All reactions