Multiple concurrent emulation sessions via separate processes

Issue #2 open
Alun Bestor
repo owner created an issue

DOSBox currently stores state in global variables, and SDL itself is designed to only track a single output view at a time. These design decisions prevent us from opening multiple DOS sessions side-by-side.

Rather than recode the hell out of DOSBox and SDL, the cleanest solution would be to move DOSBox into a separate child process for each window that talks to a main Boxer parent process (which would be responsible for event dispatch and actual rendering of the DOSBox output).

This would have the side benefits of letting us gracefully cope with DOSBox crashes (kill the process, not the application) and not link to DOSBox/SDL directly (giving us breathing-space from GPL licensing issues and allowing Boxer's code to be dual-licensed as MIT.)

However, the difficulty would come from feeding interface events to the DOS child processes and feeding their output buffers back to the parent Boxer windows. Latency would be an unknown factor in this.

Also, I have absolutely no idea where to begin with cross-process programming :)

Comments (4)

  1. Alun Bestor reporter

    Since this issue was first opened, Boxer's video and input-handling have been heavily rewritten and are now in a state that makes cross-process communication feasible. I've decided a multi-process model is the most effective use of my limited time on earth, and the "interim" solutions (multithreading, cleaning internal state to make sessions restartable) proposed earlier would be wastes of energy that would take as long or longer than a multiprocess model and achieve much less.

    BXEmulator (and DOSBox itself) would be moved off to a separate process application, and a bridge interface would be added for BXSession (and its related controllers) to communicate back and forth with it. If inspiration or guidance are needed, we can mercilessly rip off the structure used by the <a href="">OpenEMU iosurface branch</a>, though continuing to use BXFrameBuffer for video data instead of fancy 10.6-only iosurfaces.

  2. Log in to comment