Click to See Complete Forum and Search --> : Real-time in VC++


ytsau
April 5th, 1999, 01:32 PM
Hi there,

In VC++ for win98/nt, I need to start a new procedure in response to the incoming trigger signal. What I do is to keep reading the interface port and as soon as the program detects the trigger signal, it starts the new procedure.

The problem is that I find that win98/nt keeps interrupting the program from checking incoming trigger signal. It is fine with a slow checking, but when the checking is time critical (the interval should be less than 10 microsecond), the interruption can be as long as 500 microsecond. I tried to increase the process prioritiy to REALTIME but it didn't help at all.

I guess this is because of Timer, Network, and mouse moving, etc. How do I disable all other threads, programs, interruption service and only leave my program and mouse enabled under win98/nt?

Any answer or hint are welcome. Thanks a lot in advance.

ytsau

Harvey Hawes
April 5th, 1999, 03:08 PM
Hi,

First of all let me say... GOOD LUCK! Real-time programming in Win9x/NT is not fun!

The man you want to talk to is Hans Wedemyer. He's probably come up with some magical way of doing just what you want (although to be honest, I'm not sure that you can achieve the sub-10 microsec delay...). I think whats killing you is the OnIdle processing that windows has to do. I've read somewhere that windows needs between 1-3 milliseconds out of every second to do its "housekeeping" (I don't have a reference, I saw it somewhere on the net, maybe this site...). There are some articles on this site that talk a bit about this, but mainly from the precision timing point-of-view (this delay is sometimes called "latency"). High resolution response time has not been addressed very much (from what I've seen), and this is probably because microsecond resolution is not plausable in windows.

As an aside, changing process priorities rarely works for this kind of thing. Realtime settings were designed for very short boosts only (as I'm sure you found out)...

I wish I could help you, there are others on this site (H.W.) that could probably elaborate.
It might be useful to know how this signal is coming in, and how you are trying to detect it (i.e. worker thread or something).


Harvey Hawes

Software Engineer
BioScience Analysis Software Ltd.

Masters Candidate
Cardiovascular/Respiratory Sciences
Faculty of Medicine
University of Calgary
Calgary, Alberta, Canada

ytsau
April 5th, 1999, 03:43 PM
Thanks for the quick reply.

1. Who is Hans Wedemyer? I sure want to talk to him. I got to this site just today.
2. How do I disable this annoying "housekeeping" and other stuff?
3. Can Hans Wedemy give some hints?

Thanks again.