freeprocess priority

BlitzMax Forums/BlitzMax Programming/freeprocess priority

Nigel Brown(Posted 2007) [#1]
When using TProcess.Create(command, HIDECONSOLE) to spawn a child task. The child is taking almost 100% of the CPU and causes the machine to slow considerably. Is there a way to pass a priority like the task manger accepts? i.e.

Realtime
High
Above Normal
Normal
Below Normal
Low


TartanTangerine (was Indiepath)(Posted 2007) [#2]
Priority won't help you here. You need to stop the child process eating up cycles by either implementing a message pump or using a small delay in the main program loop.


Grey Alien(Posted 2007) [#3]
Yeah I wrote some code to change the priority in Windows. There's actually two different priority levels: process priority class AND thread priority. Anyway if you set them both too high it can interfere with the OS. In the end I don't use it anyway as it did weird stuff like cause delays to windows redrawing.


Nigel Brown(Posted 2007) [#4]
Thnks, I want to set the piority of this task to be low so it does not interfere with other windows tasks. I have now written a .VBS scipt to achive this but that wont execute with system_ or freeprocess.Create()??? Arggghhh windows!


SebHoll(Posted 2007) [#5]
I have now written a .VBS scipt to achive this but that wont execute with system_ or freeprocess.Create()??? Arggghhh windows!

Try passing the file path of the VBS file to OpenUrl(). ;-)


Nigel Brown(Posted 2007) [#6]
@SebHoll, Thnk's that seems to work well.