Commit 9c77265
committed
Revert FTP _PyGC_GetParallelWorkers returning adaptive_workers
The earlier change (Phase 6 step 3, commit 5501b73 in pre-rebase
SHAs) made _PyGC_GetParallelWorkers return pool->adaptive_workers so
FTP collections would scale per-collection like the GIL build. That
broke _PyGC_ParallelPropagateAliveWithPool:
assert(pool->num_workers == num_workers);
The pool dispatch path requires num_workers == pool->num_workers
because its internal phase_barrier is sized pool->num_workers at pool
init and broadcasts dispatch to all of them. Returning a smaller count
makes the assertion fire (and would deadlock the phase_barrier if the
assertion were removed).
Plumbing adaptive_workers through the FTP pool dispatch is genuinely
larger work: replace mark_barrier/done_barrier broadcast with per-worker
condvars (mirror of Phase 5.3 on the GIL side), and either dynamically
size the per-dispatch phase_barrier or remove it in favour of an
alternative sync mechanism. That's the FTP-side equivalent of Phase 5.3
+ later cleanup. Deferred to a follow-up.
In the meantime the FTP controller state (b176751 in pre-rebase
SHAs / 5ef3a61 currently) is still being updated after each
collection — same logic as the GIL build via the shared helper — but
adaptive_workers does not yet take effect on FTP. The header comment
on _PyGC_GetParallelWorkers documents the path to enable it.
Verified: FTP build, all 5 parallel-GC test files pass (177 tests, 7
skips). The 3-file regression from the previous build (test_gc_parallel,
test_gc_ft_parallel, test_gc_parallel_properties — all failing on the
assertion) is now resolved.1 parent dbe0604 commit 9c77265
1 file changed
Lines changed: 15 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
532 | | - | |
533 | | - | |
| 532 | + | |
534 | 533 | | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
539 | 547 | | |
540 | 548 | | |
541 | 549 | | |
542 | 550 | | |
543 | 551 | | |
544 | 552 | | |
545 | 553 | | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
| 554 | + | |
554 | 555 | | |
555 | 556 | | |
556 | 557 | | |
| |||
0 commit comments