Commit bb0cb0f
committed
Pre-warm TBB thread pool to eliminate QoS priority inversion warnings
The observer pattern has an inherent race: TBB workers start at Default QoS
and the OS can log a priority inversion warning before on_scheduler_entry fires.
Fix: on first call, run a trivial parallel_for whose sole purpose is to call
pthread_set_qos_class_self_np on each worker. Workers then carry User-initiated
QoS into all subsequent Manifold operations. The observer remains as a safety
net for any new workers TBB might spin up later.1 parent a5787b9 commit bb0cb0f
1 file changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
12 | | - | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
26 | 38 | | |
27 | 39 | | |
28 | 40 | | |
| |||
0 commit comments