• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to assign priority to process  RSS feed

 
manoj r patil
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchees...

For performance gain and better usability, I am running some heavy tasks in the background. I want to assign low priority to this new process as otherwise its eating the CPU and the computer remains unusable till the time process finishes off.

If I reduce the priority of this new process using windows task manager, it works just fine. Can anyone please suggest similar (pr different) way to tackle this issue?

Thanks in advance,
mrP
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless there's something new in Java 1.5/5.0/whatever (I still use 1.4), there is no way to set the priority of an external process via pure Java. You can do it via native code and JNI, on a platform-specific basis, of course.
 
Kino Lobo
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried to thread your tasks and them use the method setPriority(int newPriority) from java.lang.Thread?
 
mani vannan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you want to to prioratize the windows processes nor java threads right?
Try playing with task.exe of windows.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!