You are currently viewing the BOOK: Visual Basic 2010 Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Hi everybody,
in VB 2010, I need to set the priority level of a process to a level that will not be interrupted by the operating system (Windows 7).
Could anyone please tell me how that is done?
Thanks for you assistance.
Best regards - Walter
But Windows is a task switching operating system. If you can make a process non-interruptable, then nothing else on the system including the system itself would be able to do anything.
If you really need that, then you may need to use some other real-time operating system.
VB in windows does provide a >ProcessPriorityClass.RealTime< - so maybe I can use that - being very careful to switch back to >ProcessPriorityClass.Normal< after the non-interruptable process is finished.
the >ProcessPriorityClass.RealTime< seems to be some kind of joke: when I try to set the priorityClass to >RealTime< and then interrogate the process, asking for the status of the PriorityClass it gives back the status >High<.
Sorry, I don't have any experience with this. It could be that you don't have privileges to elevate to the highest level. You could try running the program with the "As Administrator" option to see if there's any difference.
The documentation says RealTime gives the program the highest possible priority. Perhaps the operating system won't let you go higher than High.
I used to know some people who needed real time control for things like data acquisition. They used a real time operating system not windows. But that was a long time ago.