thread/application priority
-
I'm trying to write a very time sensitive program so I need to make sure that the entire application receives the highest of priorities and that no background tasks are running. I tried using 'SetThreadPriority(hWnd,31);', but other tasks, processes, applications, etc still seem to run and interfere with the timing of my program. Is it possible to make my program such that it is the only task that is running on the computer? Thanks in advance for any help.
-
I'm trying to write a very time sensitive program so I need to make sure that the entire application receives the highest of priorities and that no background tasks are running. I tried using 'SetThreadPriority(hWnd,31);', but other tasks, processes, applications, etc still seem to run and interfere with the timing of my program. Is it possible to make my program such that it is the only task that is running on the computer? Thanks in advance for any help.
I think you could also try:
BOOL SetPriorityClass(HANDLE hProcess,DWORD dwPriorityClass);
But in my opinion, there is no way you could stop operating system processes from executing. But boosting the priority to very high could easily hang the system...Oh I see that is exactly what you are trying to do, right? this is this. -
I'm trying to write a very time sensitive program so I need to make sure that the entire application receives the highest of priorities and that no background tasks are running. I tried using 'SetThreadPriority(hWnd,31);', but other tasks, processes, applications, etc still seem to run and interfere with the timing of my program. Is it possible to make my program such that it is the only task that is running on the computer? Thanks in advance for any help.
tonyro wrote:
Is it possible to make my program such that it is the only task that is running on the computer?
I don't think so.there are many OS tasks that manage your system and you can not stop them , if you try to stop them (if you can!) the system may crash or go to an unstable condition.can you tell me the smallest unit of time you use in your program?
-
tonyro wrote:
Is it possible to make my program such that it is the only task that is running on the computer?
I don't think so.there are many OS tasks that manage your system and you can not stop them , if you try to stop them (if you can!) the system may crash or go to an unstable condition.can you tell me the smallest unit of time you use in your program?
-
Thanks for your response. I'm trying to get all events in the program to be accurate down to the one millisecond scale.
Windows is NOT a real-time OS. So, the best you could hope for is around a 10-20 ms scale. onwards and upwards...
-
I'm trying to write a very time sensitive program so I need to make sure that the entire application receives the highest of priorities and that no background tasks are running. I tried using 'SetThreadPriority(hWnd,31);', but other tasks, processes, applications, etc still seem to run and interfere with the timing of my program. Is it possible to make my program such that it is the only task that is running on the computer? Thanks in advance for any help.
tonyro wrote:
Is it possible to make my program such that it is the only task that is running on the computer?
Imagine if this were possible: * How would the screen get drawn? * How would the system read keyboard/mouse input? * How would the system access the hard drive? * How would the system manage the swap file? Windows is the wrong OS for your task. --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Strange things are afoot at the U+004B U+20DD
-
tonyro wrote:
Is it possible to make my program such that it is the only task that is running on the computer?
Imagine if this were possible: * How would the screen get drawn? * How would the system read keyboard/mouse input? * How would the system access the hard drive? * How would the system manage the swap file? Windows is the wrong OS for your task. --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Strange things are afoot at the U+004B U+20DD
-
Thanks for your response. I'm trying to get all events in the program to be accurate down to the one millisecond scale.
Windows is not a real-time OS, It’s true! But there are techniques to satisfy timing constraints of a windows real-time application with 1 millisecond accuracy. Some of them may be complex and hard to implement but they are possible. see this on MSDN: http://msdn.microsoft.com/library/en-us/dnxpembed/html/hardrealtime.asp[^] -- modified at 0:47 Thursday 5th January, 2006
-
This is why I continue to use Windows 98 on some systems and Exit to DOS, where I can control all of these functions. However, it is getting more and more difficult to maintain those machines. What modern OS would you recommend?
You can still run 98 on computers you can buy today. If 98 and DOS work for you, why change? --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Magnae clunes mihi placent, nec possum de hac re mentiri.
-
I'm trying to write a very time sensitive program so I need to make sure that the entire application receives the highest of priorities and that no background tasks are running. I tried using 'SetThreadPriority(hWnd,31);', but other tasks, processes, applications, etc still seem to run and interfere with the timing of my program. Is it possible to make my program such that it is the only task that is running on the computer? Thanks in advance for any help.
http://www.sysinternals.com/Information/TipsAndTrivia.html Look for "Never-ending Quantum?". NOTE: I only add this for interests sake. The users of you program will not thank you for disabling multitasking on his machine. Basically here's how to do it but by the way, don't do it. I haven't actually tried it myself, just came across it in my travels. Steve