Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

RE: disklabel MAXPARTITIONS reversal (was: installboot is broken)

On Saturday, March 30, 2013 at 11:38 AM, Martin Husemann wrote:
> P.P.S.: it would be realy cool if simh would not busy-poll stdin for console
> input - this voids the effort spent on idle detection.

Hi Martin,

I realized I never responded to the above P.P.S....

I'm not 100% sure what you want here.  

Currently simh idles the simulator (i.e. sleeps) when the simulated OS is in 
its own idle loop.  The simulated OS won't be exiting that idle loop until some 
external event happens (i.e. data arrives from the outside, or a clock tick 
occurs).  Simh sleeps for the amount of time necessary to satisfy the events 
which it can predict.  The predictable event it knows about is the simulated 
clock tick, so the time until the next simulated clock tick is the sleep time.  
When a simulated clock tick happens, other potential sources of external events 
are polled to determine if data has arrived.  These include console and/or 
other simulated multiplexer and network input.  So, the console and any other 
configured multiplexer devices will be polled 100 times a second.  

The above describes the behavior of all of the released versions of simh (V3.9 
and earlier).

I wouldn't quite call this a 'busy poll of stdin', but I admit that the vast 
majority of those 100 polls a second don't produce useful results.  They don't 
interfere with idling, but they certainly are extra overhead which might be 

The next 'release' of simh which is visible in the repository at 
https://github.com/simh/simh changes some of the above behaviors and adds 
asynchronous threads which perform disk and network I/O and have the ability to 
awaken a simulator which is otherwise idling when I/O completes.  This is 
better, but the multiplexer I/O is still polled on the simulated clock ticks.  
The current codebase has latent functionality (turned off by #ifdefs) to wait 
for multiplexer data arrival (with select()) in a separate thread, which will 
awaken an idling simulator when real data has arrived.  This will remove the 
100 times a second polling overhead.  This code is currently disabled since the 
goal of its implementation was to add this different behavior without changing 
any of the many simulated multiplexer devices which are part of the package.  
Much testing is required to assure consistent simulator behavior with various 
combinations of devices in different states.  This will come in a future 

Please feel free to suggest other improvements.


- Mark

Home | Main Index | Thread Index | Old Index