Skip to content

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

@eschaton

Description

@eschaton

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions