[Simh] VAX: CPU Usage and Network Timeout

Tim Riker Tim at Rikers.org
Thu Jun 9 15:36:31 EDT 2005


Tim Newsham wrote:
>> Ideally I would recommend merging all the file handles into the select
>> set. The tcp listen port(s), the current connections, the console, any
>> disk, tape or other device handles, etc. Then the sleep can be woken up
>> by any of them. Things like reading from tape won't sleep in practice
>> for emulated files, but when they are attached to real devices, they
>> could block for a while the way things are now.
> 
> How do you intend to support platforms such as win32 which do not
> allow a select on the console?

ugh. Get folks to install a real OS? =) just kidding...

probably have to select() on the others for a real short time, then
check for hit keys, then select() again, etc. I'm not a win32 expert
though, perhaps there is a more efficient way?

>>> The best way would be to tell the emulator the location of the idle
>>> loop.
>>> It usually resides at a specific location for most OS's. Then just watch
>>> for that location.
>>
>>
>> if known, sure. But watching for PC looping on a small set of
>> instructions might be able to figure that out by itself.
> 
> What logic would you propose to detect these loops?
> Sounds expensive.

Well, I'm not sure it'll work at all. However a good place to start
might be a bitmap of address bits and a separate counter. If the bit is
for this address is unset, inc the counter, then set the bit. After n
instructions, check the counter, then clear it and the bitmap. If the
counter is low, then we are idle. If it approaches the n instructions we
ran, then we are busy. For small memory boxen, this method could work,
though as you mention is might be too processing intensive to leave in
as a normal case. I've not tried this, just thinking out loud.

> 
>> Tim Riker - http://Rikers.org/ - TimR at Debian.org
> 
> 
> Tim Newsham
> http://www.lava.net/~newsham/
> _______________________________________________
> Simh mailing list
> Simh at trailing-edge.com
> http://mailman.trailing-edge.com/mailman/listinfo/simh


-- 
Tim Riker - http://Rikers.org/ - TimR at Debian.org
Embedded Linux Technologist - http://eLinux.org/
BZFlag maintainer - http://BZFlag.org/ - for fun!



More information about the Simh mailing list