Commit abf876b
committed
Set thread QoS to USER_INITIATED on Apple Silicon
On Apple Silicon Macs, TBB worker threads are created with the default
QoS class, which macOS may schedule to efficiency cores even when
performance cores are available. This significantly degrades parallel
performance.
This adds a pthread_set_qos_class_self_np() call in on_scheduler_entry()
to set USER_INITIATED QoS, signaling to macOS that these are compute
threads the user is waiting for. This causes macOS to prefer performance
cores when available.
Fixes #32771 parent 42063be commit abf876b
1 file changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
| |||
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
23 | 32 | | |
24 | 33 | | |
25 | 34 | | |
| |||
37 | 46 | | |
38 | 47 | | |
39 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
40 | 56 | | |
41 | 57 | | |
42 | 58 | | |
| |||
0 commit comments