i was going through concurrent hash map , as per my knowledge at this point , they are by default segmented into 16 parts. each part have its own share of key value pairs. If a thread want to hold a lock on a key value pair it will lock that entire segment. (Please correct me if i am wrong anywhere). Now in this link it is mentioned as chm is good when writers are less . i was wondering if we increase the number of segments , i mean making it comparable to number key value pairs , isnt it possible to create concurrency for large number of writer threads operating on the same CHM . Also, how costly will it be as far as memory consumption is concerned due to locks present in the CHM.
Thanks
Jayendra