I have a C++ program I wrote as a pure DOS app, which would be fun to move to Windows. I used DOS because it is a real-time application, and must never be interrupted even for an instant by Windows deciding to clean up some files or something. My timing is crucial, and is controlled by reprogramming the timer chip. My smallest increment of time is 1/3600th of a second, and it must never be compromised. The program needs to tie up the computer for the duration, which could be an hour or more.

I found in the MS Knowledge Base a mention of setting the priority of a spawned task. There was a warning about the possibility of locking up the computer, no mouse response, etc, if you set something to the highest priority. That sounds like just what I need! While it's running, the only intervention I would ever want would be an emergency stop, which hopefully I could trigger through the printer port (which I'm already using for I/O).

Has anybody used these techniques? I'm not clear on how to implement it. Do I need all the time-critical code in a separate .exe which is spawned with high-pri? Then a front-end program would launch it, and regain control when it's done (or interrupted)? Then the front-end would be the only Windows app, and the spawned job would just be a number-cruncher and do the I/O. I guess the front-end would pass all the necessary properties via argv[]. Can the spawned job pass anything back to the front-end?

The most important question is, will it really work? Will the spawned job really lock out Windows but still communicate with the port?

Any insight will be greatly appreciated!