Commit 7cf9612
committed
perf(qwp): wake quiescence waiters only when one is parked
serviceRing's per-pass finally called lock.notifyAll() unconditionally -
with the default 1 ms poll that is ~1000 wakeups/sec per registered ring
on the production worker, paid for a barrier (awaitRingQuiescence) that
production never takes: all three production constructions own their
manager, so close() goes through manager.close()+isWorkerReaped() and
never parks on the lock.
- new quiescenceWaiters count, incremented/decremented around the
awaitRingQuiescence wait loop under the same lock as the worker's
check - no lost-wakeup window, and the timed wait remains a fallback
- the per-pass finally notifies only when quiescenceWaiters > 0; in
steady state it never fires
- notifyAll (not notify) retained when a waiter exists: with a shared
manager, distinct waiters may await different rings1 parent d3b6147 commit 7cf9612
1 file changed
Lines changed: 32 additions & 12 deletions
Lines changed: 32 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
112 | 120 | | |
113 | 121 | | |
114 | 122 | | |
| |||
284 | 292 | | |
285 | 293 | | |
286 | 294 | | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
298 | 309 | | |
| 310 | + | |
| 311 | + | |
299 | 312 | | |
300 | 313 | | |
301 | 314 | | |
| |||
553 | 566 | | |
554 | 567 | | |
555 | 568 | | |
556 | | - | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
557 | 577 | | |
558 | 578 | | |
559 | 579 | | |
| |||
0 commit comments