[PATCH] Cygwin: sched_setscheduler: allow changes of the priority
Jon Turney
jon.turney@dronecode.org.uk
Mon Nov 25 22:38:26 GMT 2024
On 25/11/2024 19:15, Corinna Vinschen wrote:
> Hi Christian,
>
> On Nov 25 15:00, Christian Franke wrote:
>> Corinna Vinschen wrote:
>>> Fixes: ...?
>>
>> ... the very first commit (cgf 2001) of sched.cc :-)
>>
>> New patch attached.
>>
>> From e95fc1aceb5287f9ad65c6c078125fecba6c6de9 Mon Sep 17 00:00:00 2001
>> From: Christian Franke <christian.franke@t-online.de>
>> Date: Mon, 25 Nov 2024 14:51:04 +0100
>> Subject: [PATCH] Cygwin: sched_setscheduler: allow changes of the priority
>>
>> Behave like sched_setparam() if the requested policy is identical
>> to the fixed value (SCHED_FIFO) returned by sched_getscheduler().
>>
>> Fixes: 6b2a2aa4af1e ("Add missing files.")
>
> Huh, yeah, this is spot on. I wonder if it would make sense to change
> that to 9a08b2c02eea ("* sched.cc: New file. Implement sched*.")
> though, given that was the patch intended to add sched.cc :)))
>
> Sorry, but I have to ask two more questions:
>
> - Isn't returning SCHED_FIFO sched_getscheduler() just as wrong?
> Shouldn't that be SCHED_OTHER, and sched_setscheduler() should check
> for that instead? Cygwin in a real-time scenario sounds a bit
> far-fetched...
I believe if you look into the git history, we used return SCHED_OTHER
and this was changed at some stage to SCHED_FIFO.
I don't know why.
(I came across this when fixing up some testsuite tests of this)
More information about the Cygwin-patches
mailing list