Articles tagged with dayjob

Class of the day: ConcurrentHashMap

By john

Well today at work involved me using ConcurrentHashMap and in particular putIfAbsent to severely reduce the need for old-school synchronized blocks.

Just a shame that you can't pass in arbitrary expressions/blocks that will only be evaluated if the value isn't present when you call putIfAbsent. Might become feasible if …