Across most of the emulators I've studied ensuring the timing of the emulated chips lines up correctly has consistantly required some care, but nowhere more so than for the Super Nintendo Entertainment System! So BSNES bundles a cooperative multithreading library "LibCo".
The core logic here is CPU-specific (implemented for AArch64, AMD64, ARM, PowerPC, PowerPC64v2, SJLJ via UNIX signal handlers, & x86) writing all registers to one pointer whilst reading them from another.
1/2?