On Wednesday, April 10, 2013 at 10:49 AM, David T Hittner wrote:
> To answer your questions:
> 
> 1> Yes, you could detach the command channel from the simulation loop by
> putting the command channel in a different thread. The problem then
> becomes one of synchronization between the two threads to do the
> [limited] amount of things that should be allowed while the simulation loop is
> still running. You would also need to put in options to enable/disable
> command-channel threading - some people do not want to change the
> removable media "on the fly", and some older host systems do not support
> pthreads. Someone may have already submitted this code, or it may be in
> the next version of SIMH (4.0), it would be best to check with Mark.

The synchronization issues you raise certainly are necessary, but they could 
readily be done the 'simh' way by having a device (not necessarily one the 
simulated operating system knows about) which provides the necessary interfaces 
to the current simulator environment.  It could have a separate thread which 
manages the interface and schedules itself (queue a simh event) to poll the 
interface managed by the interface thread a couple of times a second, and 
depending on what the interface needed done, could attach/detach devices, etc. 
as desired.

- Mark

_______________________________________________
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh

Reply via email to