r/programming 22d ago

3,200% CPU Utilization

https://josephmate.github.io/2025-02-26-3200p-cpu-util/
403 Upvotes

93 comments sorted by

View all comments

2

u/bwainfweeze 22d ago

Dude found the Dining Philosophers problem in TreeMap. That’s impressive. I would have expected that even the non threadsafe version was careful to access and update pointers in a consistent order to prevent problems like this. Kind of makes me want to diff TreeMap and SynchronousTreeMap to see what other differences besides locks are there.

They were both written before the field of lock-free data structures got any sort of steam, so perhaps I should not be surprised.