Files
metal2vulkan/crates
Anees Iqbal 56fc28e12d metal2vulkan-rt: a reaper thread frees what the other threads give up
The planner's decision on (c): no driver free runs on the completion thread, since NVIDIA's frees
take 1-11 ms and would delay every later completion, and a submission on another thread waits
behind at most one free.

- A fourth runtime thread, the reaper, destroys event semaphores (the events gauge falls with
  each) and command pools past the idle ones kept, one at a time, in the order given. Every
  EventInner drop and every surplus recorder goes to it, whichever thread gives it up.
- A last handle dropped on the completion thread (a handler or listener) hands the whole teardown
  to the reaper: it stops and joins the other threads, gives the consumer's blocks back, and the
  core drops there. Every gauge still reads zero only once vkDestroyDevice has returned.
- Stops wait for a thread only where it is not the calling thread, by a per-thread role in a
  constant thread-local without a destructor. The reaper stops last, after its queue is empty;
  frees given after that are made at the core's drop.
- The handler teardown test now takes a block and checks it is unmapped once, on the reaper.

Verified: cargo fmt; the compile and device jobs follow.
2026-11-17 08:12:44 -08:00
..