[PATCH] Cygwin: sched_setscheduler: accept SCHED_OTHER, SCHED_FIFO and SCHED_RR
Corinna Vinschen
corinna-cygwin@cygwin.com
Tue Dec 3 10:19:17 GMT 2024
On Dec 2 19:58, Christian Franke wrote:
> ASSI wrote:
> > Christian Franke writes:
> > > + nice value sched_priority Windows priority class
> > > + 12...19 1....6 IDLE_PRIORITY_CLASS
> > > + 4...11 7...12 BELOW_NORMAL_PRIORITY_CLASS
> > > + -4....3 13...18 NORMAL_PRIORITY_CLASS
> > > + -12...-5 19...24 ABOVE_NORMAL_PRIORITY_CLASS
> > > + -13..-19 25...30 HIGH_PRIORITY_CLASS
> > > + -20 31...32 REALTIME_PRIORITY_CLASS
> > That mapping looks odd… care to explain why the number of nice values
> > and sched_priorities doesn't match up for each priority class? 39
> > possible values for one can't match to 32 for the other of course, but
> > which ones are skipped and why?
>
> I don't know as I only documented the long standing existing mappings here.
Yeah, call it "history". The original scheduler priorities as defined
by the original code in commit 6b2a2aa4af1e from 2001 were not overly
POSIX compatible. So I took a stab at rewriting it, in
450f557feee5 ("Rewrite scheduler functions getting and setting process
and thread priority"), albeit I don't know anymore what triggered this.
For the reasoning, see the commit message of 450f557feee5.
Everybody, feel free to correct this approach if it was ill-advised.
Corinna
More information about the Cygwin-patches
mailing list