Commit a7d7b9e
Cygwin: Carry process affinity through to result
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.)
Reported-by: Christian Franke <[email protected]>
Addresses: https://cygwin.com/pipermail/cygwin/2025-March/257616.html
Signed-off-by: Mark Geisert <[email protected]>
Fixes: 641ecb0 ("Cygwin: Implement sched_[gs]etaffinity()")1 parent f74dc93 commit a7d7b9e
2 files changed
+13
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
590 | | - | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
591 | 598 | | |
592 | | - | |
| 599 | + | |
593 | 600 | | |
594 | 601 | | |
595 | 602 | | |
| |||
0 commit comments