3
80
558
52K
542
Download Image
@theskilledcoder CAS is only used when inserting into an empty bin. Otherwise there is a per bin lock which is used.
@theskilledcoder The use of CAS is true for some operations in ConcurrentHashMap (e.g., updating counters or small modifications), but for insertions that involve structural changes (like adding to a bucket), a lock is typically acquired to ensure thread safety. A proper explicit lock