Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×

Permanently Set Process Priority in Windows? 125

Dave asks: "I have a render farm set up for 3D Studio Max. I have a Render user that runs 3dsmax.exe when it is sent jobs by the render farm server. I have tried to set the process to low when it runs, and it works. However, when the computer is finished rendering the images, and is sent a new set to render, the priority goes back to normal (program closes in between renderings). This obviously defeats the purpose of rendering an image in the background while others are still working, as you can imagine having 3dsmax.exe pegged at 100% CPU, slows down the machine tremendously. Is there anything that can be done to set the render user's instance of 3dsmax.exe permanently to low? Or is it possible to just set 3dsmax.exe to the low priority. I know there is a command line that sets any .exe to low, but that also starts the program. I would like 3dsmax.exe to be set to low either: when render launches the program, or set 3dsmax.exe to low whenever it is launched. Can anything be done?"
This discussion has been archived. No new comments can be posted.

Permanently Set Process Priority in Windows?

Comments Filter:
  • Simple (Score:2, Interesting)

    by addaon ( 41825 ) <addaon+slashdot.gmail@com> on Tuesday September 05, 2006 @10:57AM (#16044621)
    Just change priority.c and recompile the kernel.

    Oh, they don't let you do that? Sounds like your "soft"ware is a little brittle.
  • MOD PARENT UP (Score:1, Interesting)

    by Anonymous Coward on Tuesday September 05, 2006 @11:32AM (#16044922)
    This is how it's done in the real world, major 3d houses demand full source code to their entire tool chain.
  • by amliebsch ( 724858 ) on Tuesday September 05, 2006 @12:34PM (#16045464) Journal

    I agree with above. For example, the following C# code works (.NET 2.0):

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Diagnostics;
    using System.Threading;
     
    namespace SetLowPriority
    {
        class Program
        {
            static void Main(string[] args)
            {
                string pname=null;
     
                if (args.Length==0)
                {
                    Console.WriteLine("You must specify a process name.");
                }
                else
                {
                    pname = args[0];
                }
     
                while(true)
                {
                    Thread.Sleep(1000);
                    checkForProcesses( pname);
                }
     
            }
     
            static void checkForProcesses(string pname)
            {
                if (Process.GetProcessesByName(pname).Length == 0)
                {
                    Console.WriteLine("{0} is not running.", pname);
                }
                else
                {
                    int processCount = 0;
                    foreach (Process p in Process.GetProcessesByName(pname))
                    {
                        if (!(p.PriorityClass == ProcessPriorityClass.BelowNormal))
                        {
                            p.PriorityClass = ProcessPriorityClass.BelowNormal;
                            processCount++;
                        }
                    }
                    Console.WriteLine("{0} is running; {1} instances switched to low priority.", pname, processCount);
                }
            }
        }
    }
  • by anomaly ( 15035 ) <[moc.liamg] [ta] [3repooc.mot]> on Tuesday September 05, 2006 @05:13PM (#16047716)
    This is a sore point for me.

    I've got an XP box with 1.5GB RAM. Just checking Process Manager, I've got ~900MB RAM free - and less than 500MB of apps using RAM. Windows' default paging algorithm aggressively swaps LRU blocks, so regardless of whether I'm using all of my RAM (or more than 30%) I can count on windows swapping for a good amount of time during my work day - especially if I've had an application open and unused for a few hours.

    Your suggestion about disabling SWAP works - application access is rather like a rocket. Good show! Except for the fact that when swap is disabled, hibernation no longer works. In fact, I have to use a RAM defragger to keep Windows from blue screening when I hibernate. I call it "hibernation roulette."

    So, with windows, I have to choose whether I swap during the day, or whether I have to shut down and restart all of my applications every day. Ick.

    Any suggestions about how to be able to avoid swap *and* hibernate?
    FWIW, upgrading to SP2 and applying http://www.microsoft.com/downloads/details.aspx?am p;displaylang=en&familyid=4cbc68d2-09e1-4511-af14- 03f357180135&displaylang=en [microsoft.com]
    didn't help.....

1 + 1 = 3, for large values of 1.

Working...