----- start of file -----



CPUSet 4.443 (2004-06-10)

Copyleft 2004, Benjamin Despres, released under the GPL2.



Purpose:

    A tool to run a program with any desired CPU affinity and
    process priority.  Also includes a parameter to set the affinity
    and priority after a short delay, to allow (possibly) overriding
    any values manually set by the target program on startup.



Usage:

    Extract the program from the zip file (which
    you've already done, if you can read this).

    Either from a command prompt, or in a shortcut,
    use the following syntax:

        cpuset.exe <affinity> <priority> <delay> <command>

    With the parameters meaning the following:

        affinity:  A (decimal) mask specifying which CPUs to use.  For
                   a few example values to get the idea, for those not
                   familiar with using bitmasks:
                   1 = 0001b = cpu0          5 = 0101b = cpu0, cpu2
                   2 = 0010b = cpu1          6 = 0110b = cpu1, cpu2
                   3 = 0011b = cpu0, cpu1    7 = 0111b = cpu0, cpu1, cpu2
                   4 = 0100b = cpu2          etc.

        priority:  Process priority from 1 to 6:
                   1 = Idle/Low              4 = Above Normal
                   2 = Below Normal          5 = High
                   3 = Normal                6 = Realtime (Dangerous!)
                    
        delay:     Delay, in milliseconds, before setting the affinity and
                   priority.  Use a zero for no delay.  A value of 1000,
                   meaning one second, will work to override most programs
                   that set their own default value.

        command:   The command line of the target program.  If a given
                   parameter (in particular, the program name itself)
                   includes a space, make sure to quote that parameter,
                   or you will get very unpredictable results.  If you
                   need to doubly-quote a paramer, good luck, I haven't
                   tested that situation, so it may or may not work.

    So basically, to run "foo.exe paramater1 parameter2", limiting it to
    CPU1, with Above Normal priority, after a delay of half of a second,
    you would use "cpuset 2 4 500 foo parameter1 parameter2".



Notes:

    Although extensively tested, I cannot guarantee the correct
    operation or safety of using CPUSet.  It does not ever touch
    the disk, or close any windows (other than itself), so in the
    worst case scenario, the process you attempt to start with it
    may not start, or start with an unintended affinity or priority.

    CPUSet may not work correctly with all programs.  This can occur
    for two primary reasons.

    First, any process that changes its security attributes may
    succesfully prevent CPUSet from modifying the CPU affinity and
    priority class.

    Second, although the delay parameter allows changing from the
    defaults of a program that sets its own affinity and priority,
    this will occur only once, after the specified delay.  Thus, a
    program that periodically changes its affinity and priority will
    return to its defaults after the second such change.  I could
    have CPUSet stay active and constantly monitor such a process,
    but in general, I would consider it unwise to force any given
    values on a program that so doggedly insists on a given affinity
    and priority.



License/Disclaimer:

    I have released this program under the GPL2, which you will find
    at the bottom of the included source code, "cpuset.c".

    Use at your own risk.

    If you use the included source code, or a trivial variant thereof,
    I ask that you give me credit for it.  Under the GPL, I cannot
    force that as a condition of using this code, but consider it
    the "right" thing to do if you appreciate my work.



----- end of file -----
