Re: SetPriority() Question



On May 19, 12:53 pm, Green <myflame...@xxxxxxxxxxx> wrote:

Although I changed proc1's priority to P_VERY_LOW but increased
proc2's, I didn't get the output that I expected as the followings:
Process two is running.
Process one is running.

Probably because process one was 100% complete before process two even
started.

Could anyone correct me please ? Thanks a lot in advance!!!

There is nothing to correct except your expectations. Priorities do
not force ordering and only apply to situations where there is
contention for CPU resources.

One thing that *might* help is raising the priority of the process
that creates the other two processes so that it is more likely to
create both processes before either runs to completion. But priorities
are not the guarantees you seem to expect them to be.

For one thing, priorities don't apply when one process hits a page
fault. A lower-priority process may get the CPU because the higher-
priority process can't make forward progress at that instant. Also, if
you have more than one CPU, more than one process will run at a time.

The problem is entirely in your expectations. You cannot use
priorities to enforce ordering, and much code that has tried to do so
has broken.

DS

.



Relevant Pages

  • Re: [ck] Re: [PATCH][RSDL-mm 0/7] RSDL cpu scheduler for 2.6.21-rc3-mm2
    ... interactivity loses. ... that you are prioritising things to normal or background tasks. ... background, but relatively less cpu. ... RSDL is to change your expectations slightly and your settings from ...
    (Linux-Kernel)
  • Re: VMS process priorities and system processes
    ... could otherwise block critical server processes. ... > priorities on specific priorities. ... > "The class scheduler provides the ability to limit the amount of CPU ... > enabled for their scheduling class. ...
    (comp.os.vms)
  • Re: tvtime and the Linux 2.6 scheduler
    ... Con Kolivas: ... It sounds like it's giving X less cpu ... I will get accurate information about the priorities of all processes ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: Compressing log files and CPU load
    ... CPU quota is as much ... a feature as HD quota and mail quota on a real OS. ... > process priorities which I think can be tweaked in the shortcut... ... is man only a blunder of God, or God only a blunder of man? ...
    (comp.compression)
  • Re: [PATCH][RSDL-mm 0/7] RSDL cpu scheduler for 2.6.21-rc3-mm2
    ... that you are prioritising things to normal or background tasks. ... background, but relatively less cpu. ... RSDL is to change your expectations slightly and your settings from ...
    (Linux-Kernel)