ConcurrentHashMap internal working in java | ConcurrentHashMap internal implementation in java

preview_player
Показать описание
In this video we will learn about how ConcurrentHashMap internal works in java
Рекомендации по теме
Комментарии
Автор

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 _/\_

jayjoshi
Автор

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.

Azhagusuryaa
Автор

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

ruchirpandit
Автор

segment is used in java 8 you can see comment over segment

dileepmaurya
Автор

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.

gemphu
Автор

Best efforts but language is a constraint while explanation. If Hindi is better then opt for Hindi tutorials rather than English ones.

pareshbapna
Автор

Please correct your explanation about segment, its not correct

alavudin
Автор

Try to explain the concept ... average users will not be able to understand your explanation.

zmxncbv
welcome to shbcf.ru