I found this explanation perfect for ConcurrentHashMap. Thanks for your efforts and sharing this with us. But a question arises --> If ConcurrentHashMap is not a better choice in case of more write operation doing Threads as it blocks and decrease the performance, then what would be another better choice ? Which data structure to use in place of ConcurrentHashMap if an app is having multiple write operations concurrently ? Please provide me an answer for this. Thanks _/\_
@dileepmaurya84116 жыл бұрын
segment is used in java 8 you can see comment over segment
@pareshbapna33866 жыл бұрын
Best efforts but language is a constraint while explanation. If Hindi is better then opt for Hindi tutorials rather than English ones.
@Azhagusuryaa26966 жыл бұрын
Is data itself partioning as segments when they are created.?? Like i have added 16 entries in the map. 1 segment. What happened when im adding the 17 th entry. My doubt is 1.how the segment is being created whether from the existing data or data entry put into the segments, 2. How segment retrieval happens for acquiring the lock.
@ruchirpandit18856 жыл бұрын
So, concurrent hashmap is not a great choice if too many threads are writing to map as write operation creates lock on segment and if multiple threads write to same segment then it has perf impact. do you know of better choice for multiple write concurrency than concurrenthashmap ? Thanks
@gemphu12345 жыл бұрын
In the diagram , you are showing each bucket of the hash table array is locked and you are calling them segment. It is not right. segment array is different and each segment may point to some of the bucket range in the hash table array based on the number of segments or concurrency level.
@alavudin76954 жыл бұрын
Please correct your explanation about segment, its not correct
@zmxncbv956 жыл бұрын
Try to explain the concept ... average users will not be able to understand your explanation.