[PATCH v2] Cygwin: Carry process affinity through to result
Corinna Vinschen
corinna-cygwin@cygwin.com
Tue Mar 18 09:34:46 GMT 2025
On Mar 18 00:53, Mark Geisert wrote:
> Due to deficient testing, the current code doesn't return a valid result
> to users of sched_getaffinity(). The updated code carries the determined
> procmask through to the generation of result cpu mask.
>
> Recognize Windows' limitation that if the process is multi-group (i.e.,
> has threads in multiple cpu groups) there is no visibility to which
> processors in other groups are being used. One could remedy this by
> looping through all the process' threads, but that could be expensive
> so is left for future contemplation. In addition, we'd have to maintain
> our own copy of each thread's current group and mask in internal overhead.
> (By the way, multi-group processes are only possible on Windows systems
> with more than 64 hardware threads.)
>
> A release note for 3.6.0 is included.
>
> Reported-by: Christian Franke <Christian.Franke@t-online.de>
> Addresses: https://cygwin.com/pipermail/cygwin/2025-March/257616.html
> Signed-off-by: Mark Geisert <mark@maxrnd.com>
> Fixes: 641ecb07533e ("Cygwin: Implement sched_[gs]etaffinity()")
>
> ---
> winsup/cygwin/release/3.6.0 | 4 ++++
> winsup/cygwin/sched.cc | 11 +++++++++--
> 2 files changed, 13 insertions(+), 2 deletions(-)
Pushed.
Thanks,
Corinna
More information about the Cygwin-patches
mailing list