Skip to content

Conversation

@coolreader18
Copy link
Member

In preparation for threading; we want to keep some properties of the vm consistent across threads, so I'm moving the ones that should be into an Arc.

@coolreader18 coolreader18 force-pushed the coolreader18/arc-vm-state branch from 27e5163 to 5f93f83 Compare May 17, 2020 05:44
@coolreader18 coolreader18 marked this pull request as ready for review May 17, 2020 05:44
pub struct PyGlobalState {
pub settings: PySettings,
pub stdlib_inits: HashMap<String, stdlib::StdlibInitFunc>,
pub frozen: HashMap<String, bytecode::FrozenModule>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the frozen modules should be a global static? This should not change between VMs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but it's possible that someone would want to inject a frozen module into one VM to wrap their API or something, but want to use another vm for something different. I've done that myself in another project that uses RustPython.

@coolreader18 coolreader18 merged commit 6ed172d into master May 22, 2020
@coolreader18 coolreader18 deleted the coolreader18/arc-vm-state branch May 22, 2020 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants