Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Just FYI, ConcurrentHashMap is indeed lockfree (although it's got a gargantuan memory footprint). Wrapping your HashMap with Collections.synchronizedMap gives you a blocking threadsafe HashMap.


ConcurrentHashMap is not lock free, it uses lock striping across multiple buckets.


I stand corrected.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: