Comment 3 for bug 792781

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.