My flat combiner’s lock is a single 32-bit int. Currently, it’s a hotspot as before enqueuing into the wait queue, every thread touches it, pulling its cache line into their core's cache Shared or Exclusive mode. I wonder if I distribute this?
Just tracked down an L3 bound issue today. Small refactor reduced contended accesses and data sharing roughly in half in the waiter path. Pretty neat tbh
@ptr_to_joel Genuinely enjoy the lower level aspects of concurrency. I remember building an mvcc in memory transactional map a while back. Was pretty buns but yeah it was fun
Just spent a week chasing a 60ms p99.99 stall in my Java flat combiner. Seems spinning waiters were probably starving the combiner they were waiting on.
Rewrote my waiting strat. Tail stalls mostly gone. Mean latency got worse. Concurrency is just trading one problem for another
Building blocking synchronizers is pretty hard. The memory ordering is very intricate and debugging an infintely blocked thread on an oversubscribed machine can make one run mad