Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

civguy

Setting program priority.

This topic is 6427 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have made a server application which *should* use about 50% of computer''s resources all the time so that it''d work well. But whenever I start another application and the server program isn''t active (i.e. it''s on background), the server slows down to 10-20 ticks/sec (normally 20000 ticks/sec).. How to set a higher priority for this program so that Windows gives it some resources even when it''s not active. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Try this;

You''ve got to find out your game''s process ID first:

HANDLE hProc;
hProc = GetCurrentProcess(); // Find process

That''s it. Now you can set your process priority by choosing from below:

SetPriorityClass(hProc,IDLE_PRIORITY_CLASS); // low
SetPriorityClass(hProc,NORMAL_PRIORITY_CLASS); // normal
SetPriorityClass(hProc,HIGH_PRIORITY_CLASS); //high
SetPriorityClass(hProc,REALTIME_PRIORITY_CLASS); ultra high!!

I think thats what you was looking for.

Alan

IF YA SMELL... WHAT THE BEZZ IS COOKIN''''

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!