YRC: use a side-table for topology (#26022)

- Much better locking scheme
- Run concurrently with the mutators
- Thread local collections
- Tarjan's algorithm for cycle collection
This commit is contained in:
Andreas Rumpf
2026-07-20 08:38:54 +02:00
committed by GitHub
parent 3bb46d3217
commit c4716ed461
6 changed files with 2410 additions and 584 deletions

View File

@@ -27,6 +27,10 @@ else:
template afterThreadRuns() =
for i in countdown(nimThreadDestructionHandlers.len-1, 0):
nimThreadDestructionHandlers[i]()
when declared(nimYrcThreadTeardown):
# YRC: spill this thread's candidate roots so its garbage remains
# collectible after the thread is gone
nimYrcThreadTeardown()
proc onThreadDestruction*(handler: proc () {.closure, gcsafe, raises: [].}) =
## Registers a *thread local* handler that is called at the thread's