Manage Scheduling Priority of PTBatcherGUI

Bug #792781 reported by Yuv
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Hugin
Triaged
Wishlist
Unassigned

Bug Description

YL > Wishlist for PTBatcherGUI
YL > * add a switch to start it "nice" (to leave priority to the user
YL > interaction with Hugin)

TM > What is "nice"? That's a very weak description. I don't know what you
TM > want.

I don't now if this exists in Windows. In Linux (and I guess also on the Mac), I can start a command with `nice -n X COMMAND ARGS` and it has higher or lower scheduling priority depending if X is negative or positive. Details in `man nice`.

I guess I could pre-pend the nice command in the call from PanoPanel.cpp but I am not sure how this would (or would not) affect the whole thing.

Revision history for this message
tmodes (tmodes) wrote :

> Details in `man nice`.
This does not help me.

Short test on windows: change priority of ptbatchergui to high, but started child processes (make/cpfind/nona) are all running with normal priority. So at least on windows changing the process priority of ptbatchergui would not help so much. (Nice does only change the cpu priority, but maybe also the i/o priority needs to be changed.)

 wxExecute - which is used to start make - does not support a priority switch.

Revision history for this message
Yuv (yuv) wrote : Re: [Bug 792781] Re: Manage Scheduling Priority of PTBatcherGUI

On June 4, 2011 10:36:44 AM tmodes wrote:
> > Details in `man nice`.
>
> This does not help me.
>
> Short test on windows: change priority of ptbatchergui to high, but
> started child processes (make/cpfind/nona) are all running with normal
> priority. So at least on windows changing the process priority of
> ptbatchergui would not help so much. (Nice does only change the cpu
> priority, but maybe also the i/o priority needs to be changed.)
>
> wxExecute - which is used to start make - does not support a priority
> switch.

I suspected that the started child processes were all running with normal
priority. Managing scheduling priority is a wish. Maybe it needs to be
implemented at the make level and not at the PTBatcherGUI level.

Ideally I would like a system that gives priority to the user's interaction
with the GUI, rather than treating all processes equal and making the user
wait.

tmodes (tmodes)
Changed in hugin:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
rew (r-e-wolff) wrote :

Yes, the term "nice" is platform dependent.

However, running the batch processes at a lower CPU priority (and if possible, a lower IO priority as well) is a cross platform issue.

Even if windows wouldn't support it, the support can and should be conditional on the compilation environment. There is OS interaction, so there will be some OS dependent code.

In unix, a process can set its CPU priority with a system call. All children will then inherit this priority. If you have to use "wxExecute" which doesn't have a priority argument, you can write a wrapper that does:

wxPrioExecute (int prio, ....)
{
   if (!fork ())
      nice (prio);
      wxExecute (....);
      exit ();
   }
}

It could ignore the argument on Windows, or leave the implementation for a later moment when someone with the proper windows skills comes along.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.