Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

CNiTimer and threads?

If I derive a class from CNiTimer to handle the OnEvent method then the documentaion says this will run in a system thread. My question is: If I derive say 8 classes from CNiTimer will these run in 8 seperate system threads. I don't see these threads in the Task manager.
0 Kudos
Message 1 of 5
(3,395 Views)
There is only 1 timer thread per process. CNiTimer uses the Windows multimedia timer, which is limited to a single instance per process. See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/mmtime_4msz.asp

for more information on Windows multimedia timers.
0 Kudos
Message 2 of 5
(3,395 Views)
Thanks for the answer, but that is just not true.
On Win9X there are 32 multimedia timers for the entire system and I can't find any limitation on per-process use. On WinNT each process can have up to 16 multimedia timers. I don't know the specs for W2K and above, but I would use a queue timer.

As I suspected this is a limitation of the NI timer, so I wont use it.

Thanks
0 Kudos
Message 3 of 5
(3,395 Views)
I stand corrected. I had misinterpretted some internal documentation.

You are correct that 1 timer thread per process is an implementation limitation of the CNiTimer class.

David Rohacek
National Instruments
0 Kudos
Message 4 of 5
(3,395 Views)
Thanks for the help
0 Kudos
Message 5 of 5
(3,395 Views)