Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multithreaded emulation: Remove globals and take context argument pervasively #112

Open
eschaton opened this issue Dec 16, 2024 · 0 comments

Comments

@eschaton
Copy link

I'm hacking on a system call emulator for a 68K operating system, and I was considering running each 68K process in a host process thread. However, most of Musashi relies on global state such that only one Musashi instance can really be used at a single time, though it does appear multiple non-concurrent emulation contexts are supported via context switching.

This context should really be an argument within the API and internals, and only defer to global state when NULL is passed instead of a real context as with m68k_get_reg(). This does mean a binary- and source-compatibility break, though a combination of naming tweaks (such as using M68K_ instead of m68k_ for the context-taking APIs) and either #defines or stubs that define the old API in terms of the new API with a NULL context would obviate that.

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

No branches or pull requests

1 participant