You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: prevent deadlock in high thread counts and pwrite livelock (#678)
Two bugs caused hangs with large PE gz FASTQ files:
1. Lock-free list deadlock: canBeConsumed() required nextItemReady or
producerFinished, but a single-item list has neither. When
thread_count > PACK_IN_MEM_LIMIT, each worker gets ≤1 pack before
reader backpressure — workers cannot consume their only pack,
processed counter never advances, readers stay blocked.
Fix: use produced > consumed as the consumability check.
2. Pwrite spin-wait livelock: hardware pause/yield instructions do not
yield OS timeslice. Under CPU contention (Docker), spinning threads
starve the predecessor thread that must publish its sequence.
Fix: replace with std::condition_variable.
Also fix per-thread compress buffer tracking (mCompBufSize was shared
and never updated, causing repeated reallocation per call).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments