Pyo3: Support sub-interpreters

Created on 14 Aug 2019  路  3Comments  路  Source: PyO3/pyo3

Does pyo3 allow the use case of starting multiple separate interpreters? This would be similar to Python's multiprocessing.

enhancement needs-design

Most helpful comment

The complexity with sub-interpreters is that no Python objects should ever be shared between them. The pyO3 API isn't set up to prevent this at the moment, so it's going to take a fair whack of experimentation before we get anything stable in place.

All 3 comments

It should be possible with the upcoming improvements in 3.8 and above.

Specifically would be amazing if it was possible to create multiple separate python interpreters that could be run on different threads in parallel, but which share the same memory space (with the type system used to ensure this is only observable from rust).

The complexity with sub-interpreters is that no Python objects should ever be shared between them. The pyO3 API isn't set up to prevent this at the moment, so it's going to take a fair whack of experimentation before we get anything stable in place.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

konstin picture konstin  路  5Comments

mvaled picture mvaled  路  3Comments

jothan picture jothan  路  3Comments

inv2004 picture inv2004  路  4Comments

konstin picture konstin  路  5Comments