HashMap vs HashTable vs ConcurrentHashMap - 01:35 - 10:35 internal of ConcurrentHashMap - 14:05(check content of board) constructors of ConcurrentHashMap - 16:40 - 18:35
Whenever i search for a topic many times your tutorial got in search, I never watched. But recently I made your videos prioritized 1st. Your giving indetail explaination for every topic. Thank you..
Hello Kartheek. Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos. You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link: goo.gl/kqvaf2
I am a former student of Durga sir and am working now for a Big 4 Giant IT company . The way he teaches the basics cannot be taught by any java language developer who are working in Oracle or take any faculty or R&D guy. This is the simplest form of java food available on planet earth . Have it while you have time. Kudos sir !!!
Very funny , how many good engineers you came across? Do you even know what is R&D?? You are still a kid in engineering, try to see real world of engineers. Durga just give answers to questions but design and analysis is a art which come by years of excellent work on large scale projects , don't insult RND guys. Improve yourself first.
Excellently explained to core important basic concepts in depth with clear UNDERSTANDING ,keep posting such important topic videos Durga Sir, Appreciate in deed.
Hello Divu. Thanks for your valuable feedback.It will boost us to do new things. Please subscribe to get updates about new videos. You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link: goo.gl/kqvaf2
Next level teaching ❤️ sir hats off literally i got frustrated due to surfing on internet about concurrent but i saw this video i stop solution i got Thankyou ✅️
Hello Sanket. Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos. You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link: goo.gl/kqvaf2
Hello Friend. Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos. You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link: goo.gl/kqvaf2
Incorrect information at 10:00 - When concurrencyLevel is greater than intialCapacity. it is not that every bucket has two lock, rather intialCapacity is made equal to concurrencyLevel. below is the source code which does this. if (initialCapacity < concurrencyLevel) // Use at least as many bins initialCapacity = concurrencyLevel; // as estimated threads That means concurrencyLevel can never be greater than intialCapacity. It will always be less than or equal to intialCapacity.
Hello Dev. Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos. You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link: goo.gl/kqvaf2
very clear explanation sir.I was searching for other websites for clear understanding but i couldn't get it.Here in this video your explanation about the topic is excellent sir.
Hello Karthik. Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos. You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link: goo.gl/kqvaf2
Hello Raj. Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos. You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link: goo.gl/kqvaf2
Hello Rakesh. Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos. You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link: goo.gl/kqvaf2
Hello Jayanta. Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos. You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link: goo.gl/kqvaf2
Hello Priyanka. Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos. You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link: goo.gl/kqvaf2
Note that in Java 8 we don't have segment locking or concurrency level. In Java 8, each hash bucket can get updated individually, so as long as there are no hash collisions, there can be as many concurrent updates as its current capacity.
Hello Shana. Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos. You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link: goo.gl/kqvaf2
Hello Sahil. Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos. You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link: goo.gl/kqvaf2
Hello Divya, Thanks for your valuable feedback.It will boost us to do new things. Please subscribe to get updates about new videos. You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link: goo.gl/U1KKyi You an see more Java videos following link: Java tutorial by durga sir goo.gl/XWb4RL Java 9 by durga sir goo.gl/hXGyBW Java 1.8 Version New Features by Durga sir goo.gl/iHXXYU Adv Java JDBC Tutorial by Durga sir goo.gl/8q16Eo OCJA 1.8 Java SE 8 Programmer - I (1Z0 - 808 ) By Durga sir goo.gl/gC6R7f Core Java by NagoorBabu sir goo.gl/s6Nvj1 Advenced Java by Nagoorbabu sir goo.gl/ZZonzJ CoreJava by Ratan goo.gl/3VM19v Advanced Java jdbc by Ratan goo.gl/Rn2UXr Advjava tutorials - JSP by Ratan goo.gl/Z6ytxm Adv java servlets tutorial by ratan goo.gl/zTwi9y Servlet and JSP Tutorial by anji reddy goo.gl/jZMRUv Advanced Java Jdbc by Anjireddy goo.gl/16CGzX Hibernate byAnjireddy goo.gl/qQojvZ Struts by Anjireddy goo.gl/nE1Eof Spring by Mr.AnjiReddy goo.gl/NfN14R ADV JAVA by Naveen goo.gl/bhSsXF Spring by Mr.Naveen goo.gl/huVwFN Hibernate by Mr. Naveen goo.gl/TY3Wpd Struts by Mr.Naveen goo.gl/Vkmiw7
Hello Yugal. Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos. You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link: goo.gl/kqvaf2
Very good explanation sir, but I have doubt on load factor because in documentation "loadFactor: the load factor (table density) for establishing the initial table size". when I pass any argument as load factor then it is used to calculate size of array to store elements, public ConcurrentHashMap(int initialCapacity, float loadFactor, int concurrencyLevel) { if (!(loadFactor > 0.0f) || initialCapacity < 0 || concurrencyLevel = (long)MAXIMUM_CAPACITY) ? MAXIMUM_CAPACITY : tableSizeFor((int)size); this.sizeCtl = cap; } If I pass load factor as 0.5 then also it resizes table after filling it 75% not after 50%. I am using java 8, please help me to understand it.
Hello Chetan. Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos. Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
He helped many dummy engineers but still durgas lectures are very basic and are not at advanced level. His lectures have explanation more at implementation level and not at design and analysis level. Working on design is a art which takes years of actual experience , it's not about finding answer to the question.
Hello Krishna. Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos. You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link: goo.gl/kqvaf2
What will happen if one thread is reading from a particular bucket and other thread is updating the same bucket? Is it even possible? Will the latest value be available for read operation?
This simultaneous operation is not possible. consider that thread A is performing read operation and thread B requests for update operation. The lock for that segment will only be given after thread A completes its read operation. thus a condition where one thread is reading and one thread is updating will not happen at all.
In a CHM this is allowed; reads are non-blocking and so read and write to and from the same bucket is perfectly allowed in CHM; and there is no inconsistency of data as well.
String s="Nand" this will create only one object that in string constant pool. string s=new String("Nand") will create two objects, one is in heap memory and second is String constant pool.
Firstly, CHM does not throw ConcurrentModificationException ; its Iterators (Enumerators etc which throw it); because Iterators which on the copy of CHM taken at the time of Iterator it is thread safe and hence no modifcation exception.
How ConcurrenthashMap manages if Concurrency level is HIGHER than the number of Buckets? like :: initialCapacity = 16, concurrencyLevel = 32 then what happens.. To this just see the below ConcurrentHashMap constructor internal implementation code public ConcurrentHashMap(int initialCapacity, float loadFactor, int concurrencyLevel) { if (!(loadFactor > 0.0f) || initialCapacity < 0 || concurrencyLevel = (long)MAXIMUM_CAPACITY) ? MAXIMUM_CAPACITY : tableSizeFor((int)size); this.sizeCtl = cap; }
Who will explain why no null keys? What will happen if 2 threads are reading a segment and 3rd thread deletes one of the entry in that segment? How is locking done? These are some of the very basic facts which you have missed. Disappointing.
I think null key is missing because of hashing of null and if the 2 threads has been started before 3rd thread, it will read that deleted item otherwise will not read.
HashMap vs HashTable vs ConcurrentHashMap - 01:35 - 10:35
internal of ConcurrentHashMap - 14:05(check content of board)
constructors of ConcurrentHashMap - 16:40 - 18:35
Whenever i search for a topic many times your tutorial got in search, I never watched. But recently I made your videos prioritized 1st. Your giving indetail explaination for every topic. Thank you..
Hello Kartheek.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
I am a former student of Durga sir and am working now for a Big 4 Giant IT company . The way he teaches the basics cannot be taught by any java language developer who are working in Oracle or take any faculty or R&D guy. This is the simplest form of java food available on planet earth . Have it while you have time. Kudos sir !!!
Tq Aryan...
true
Well said bro :)
Very funny , how many good engineers you came across? Do you even know what is R&D?? You are still a kid in engineering, try to see real world of engineers. Durga just give answers to questions but design and analysis is a art which come by years of excellent work on large scale projects , don't insult RND guys. Improve yourself first.
@@zeliofern ji zelio,can u ol ase tell what is segment or bucket in concurrent hashmap.
Excellently explained to core important basic concepts in depth with clear UNDERSTANDING ,keep posting such important topic videos Durga Sir, Appreciate in deed.
Hello Divu.
Thanks for your valuable feedback.It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
Next level teaching ❤️ sir hats off literally i got frustrated due to surfing on internet about concurrent but i saw this video i stop solution i got Thankyou ✅️
Hello Sanket.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
Thanks sir, you are really GOD of Java.
Hello Friend.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
Completed watching on Oct 13, 2024 at 12.42 AM
Incorrect information at 10:00 - When concurrencyLevel is greater than intialCapacity. it is not that every bucket has two lock, rather intialCapacity is made equal to concurrencyLevel.
below is the source code which does this.
if (initialCapacity < concurrencyLevel) // Use at least as many bins
initialCapacity = concurrencyLevel; // as estimated threads
That means concurrencyLevel can never be greater than intialCapacity. It will always be less than or equal to intialCapacity.
u are using less than symbol
wonder if different versions of java implement this differently.
Thanks Sir, today I got the clear understanding on the ConcurrentHashMap to some extent.
Hello Dev.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
ConcurrentHashMap initial capacity is 16
Fill ratio is 0.75
Concurrency level is 16❤
very clear explanation sir.I was searching for other websites for clear understanding but i couldn't get it.Here in this video your explanation about the topic is excellent sir.
Hello Karthik.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
Hello sir, Why can't you start teaching SpringBoot...it will be very helpful for us🙃🥲
Hello Shiva.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
thank you so much durga sir for your tutorials ... your tutorials are very valuable
i never ever seen a person teaches like u sir 💯
Hello Raj.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
Always super master...👌
Hello Rakesh.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
157 video completed❤🎉
He is GOD of Core Java
Hello Jayanta.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
Thank you God 🙏🏻
Awesome explanation...thank u so much Sir
Hello Priyanka.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
God bless you
Note that in Java 8 we don't have segment locking or concurrency level. In Java 8, each hash bucket can get updated individually, so as long as there are no hash collisions, there can be as many concurrent updates as its current capacity.
👏👌🐎🥳
Thanks Sir
Sir, you are great 👍
Hello Shana.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
God 🙏 of Java
Hello Sahil.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
👍👍👍👍👍👍🙏🙏🙏🙏🙏🙏👏👏👏👏👏👏
Very useful tutorial....thanks sir
Best explanation sir.
Hi Krishna. Thank you very much for your feedback
great
Hello Divya,
Thanks for your valuable feedback.It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/U1KKyi
You an see more Java videos following link:
Java tutorial by durga sir
goo.gl/XWb4RL
Java 9 by durga sir
goo.gl/hXGyBW
Java 1.8 Version New Features by Durga sir
goo.gl/iHXXYU
Adv Java JDBC Tutorial by Durga sir
goo.gl/8q16Eo
OCJA 1.8 Java SE 8 Programmer - I (1Z0 - 808 ) By Durga sir
goo.gl/gC6R7f
Core Java by NagoorBabu sir
goo.gl/s6Nvj1
Advenced Java by Nagoorbabu sir
goo.gl/ZZonzJ
CoreJava by Ratan
goo.gl/3VM19v
Advanced Java jdbc by Ratan
goo.gl/Rn2UXr
Advjava tutorials - JSP by Ratan
goo.gl/Z6ytxm
Adv java servlets tutorial by ratan
goo.gl/zTwi9y
Servlet and JSP Tutorial by anji reddy
goo.gl/jZMRUv
Advanced Java Jdbc by Anjireddy
goo.gl/16CGzX
Hibernate byAnjireddy
goo.gl/qQojvZ
Struts by Anjireddy
goo.gl/nE1Eof
Spring by Mr.AnjiReddy
goo.gl/NfN14R
ADV JAVA by Naveen
goo.gl/bhSsXF
Spring by Mr.Naveen
goo.gl/huVwFN
Hibernate by Mr. Naveen
goo.gl/TY3Wpd
Struts by Mr.Naveen
goo.gl/Vkmiw7
Please explain realtime example for hasmap and ConcarentHashmap
You explained ConcurrentHashMap very well. Thank you sir.
Hello Yugal.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
Sir can you explain with example with thread etc
Very good explanation sir, but I have doubt on load factor because in documentation "loadFactor: the load factor (table density) for establishing the initial table size".
when I pass any argument as load factor then it is used to calculate size of array to store elements,
public ConcurrentHashMap(int initialCapacity, float loadFactor, int concurrencyLevel)
{
if (!(loadFactor > 0.0f) || initialCapacity < 0 || concurrencyLevel = (long)MAXIMUM_CAPACITY) ? MAXIMUM_CAPACITY : tableSizeFor((int)size);
this.sizeCtl = cap;
}
If I pass load factor as 0.5 then also it resizes table after filling it 75% not after 50%.
I am using java 8, please help me to understand it.
Hello Chetan.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
He helped many dummy engineers but still durgas lectures are very basic and are not at advanced level. His lectures have explanation more at implementation level and not at design and analysis level. Working on design is a art which takes years of actual experience , it's not about finding answer to the question.
god of java
Hello Krishna.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
Can in one segment update operation perform parralely or not ?
Hello Samadhan.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
What will happen if one thread is reading from a particular bucket and other thread is updating the same bucket? Is it even possible? Will the latest value be available for read operation?
This simultaneous operation is not possible.
consider that thread A is performing read operation and thread B requests for update operation. The lock for that segment will only be given after thread A completes its read operation.
thus a condition where one thread is reading and one thread is updating will not happen at all.
Amitkumar Gupta It can happen and that is why concurrent hashmap is not automic and u can not rely on contains method of this.
In a CHM this is allowed; reads are non-blocking and so read and write to and from the same bucket is perfectly allowed in CHM; and there is no inconsistency of data as well.
Sir, I am big fan of you. I want to know why null is not allowed in Hashtable or in ConcurrentHashMap?
Does this playlist have DSA part?
Hello Avinash.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
What is the real time usage where we want to use concurrent hash map
Hello Anirudh.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
concurrent Hashmap is implemented with hashtable so multiple hashtable are created but does hashtable not block read operation
Could anyone help me with what is segment and bucket here?
Hello Ashish.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
done today, 18, OCT, 2024 12:05 AM
Hello sir!
I have one question what is the difference between String s = "Nand"; and String s = new String("Nand");.
Thank you sir in advance.
String s="Nand" this will create only one object that in string constant pool.
string s=new String("Nand") will create two objects, one is in heap memory and second is String constant pool.
Pls tell why ConcurrentHashMap doesnt throw ConcurrentModificationException ?
Firstly, CHM does not throw ConcurrentModificationException ; its Iterators (Enumerators etc which throw it); because Iterators which on the copy of CHM taken at the time of Iterator it is thread safe and hence no modifcation exception.
Sir, Initial bucket size by default 16 and concurrency level wants custom to set 7 then how the locking mechanism assignment will it work internally?
Hello Friend.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
How ConcurrenthashMap manages if Concurrency level is HIGHER than the number of Buckets?
like :: initialCapacity = 16, concurrencyLevel = 32 then what happens.. To this just see the below ConcurrentHashMap constructor internal implementation code
public ConcurrentHashMap(int initialCapacity,
float loadFactor, int concurrencyLevel) {
if (!(loadFactor > 0.0f) || initialCapacity < 0 || concurrencyLevel = (long)MAXIMUM_CAPACITY) ?
MAXIMUM_CAPACITY : tableSizeFor((int)size);
this.sizeCtl = cap;
}
Hello Narsimha.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
Sir, Can you please explain how we can provide lock at bucket level?
Yes please same question I have
Who will explain why no null keys?
What will happen if 2 threads are reading a segment and 3rd thread deletes one of the entry in that segment?
How is locking done?
These are some of the very basic facts which you have missed.
Disappointing.
I think null key is missing because of hashing of null and if the 2 threads has been started before 3rd thread, it will read that deleted item otherwise will not read.