Core Java With OCJP/SCJP: Concurrent Collections Part-4 || ConcurrentHashMap Details

Поділитися
Вставка
  • Опубліковано 18 січ 2025

КОМЕНТАРІ • 89

  • @prakherjindal5440
    @prakherjindal5440 Рік тому +2

    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

  • @kartheekgoud9009
    @kartheekgoud9009 2 роки тому +1

    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..

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  2 роки тому +1

      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

  • @ryan-bo2xi
    @ryan-bo2xi 8 років тому +20

    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 !!!

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  8 років тому

      Tq Aryan...

    • @Aadil046
      @Aadil046 6 років тому

      true

    • @jagadeeshsajjan5252
      @jagadeeshsajjan5252 6 років тому

      Well said bro :)

    • @zeliofern
      @zeliofern 6 років тому +1

      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.

    • @half_demon1466
      @half_demon1466 5 років тому +2

      @@zeliofern ji zelio,can u ol ase tell what is segment or bucket in concurrent hashmap.

  • @DivuSiddhu
    @DivuSiddhu 6 років тому +4

    Excellently explained to core important basic concepts in depth with clear UNDERSTANDING ,keep posting such important topic videos Durga Sir, Appreciate in deed.

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  6 років тому

      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

  • @sanketkhose8316
    @sanketkhose8316 2 роки тому +2

    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 ✅️

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  2 роки тому

      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

  • @omnamahshivaya2054
    @omnamahshivaya2054 9 місяців тому +2

    Thanks sir, you are really GOD of Java.

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  9 місяців тому

      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

  • @ranveervaghela7030
    @ranveervaghela7030 3 місяці тому +2

    Completed watching on Oct 13, 2024 at 12.42 AM

  • @narendrakjha8883
    @narendrakjha8883 6 років тому +12

    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.

    • @jonassx100
      @jonassx100 5 років тому

      u are using less than symbol

    • @aquasaiyan7877
      @aquasaiyan7877 4 роки тому +1

      wonder if different versions of java implement this differently.

  • @dkk351
    @dkk351 4 роки тому +4

    Thanks Sir, today I got the clear understanding on the ConcurrentHashMap to some extent.

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  4 роки тому +1

      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

  • @EngineerVaibhav
    @EngineerVaibhav Рік тому +4

    ConcurrentHashMap initial capacity is 16
    Fill ratio is 0.75
    Concurrency level is 16❤

  • @karthikch9343
    @karthikch9343 5 років тому +2

    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.

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  5 років тому +1

      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

  • @SHIVASAIAKULA-t7y
    @SHIVASAIAKULA-t7y 6 місяців тому +3

    Hello sir, Why can't you start teaching SpringBoot...it will be very helpful for us🙃🥲

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  6 місяців тому

      Hello Shiva.
      Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28

  • @persistencej3116
    @persistencej3116 8 років тому +1

    thank you so much durga sir for your tutorials ... your tutorials are very valuable

  • @saravanaraj4705
    @saravanaraj4705 2 роки тому +1

    i never ever seen a person teaches like u sir 💯

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  2 роки тому

      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

  • @europeteluguvlogsbykiwi
    @europeteluguvlogsbykiwi 4 роки тому +3

    Always super master...👌

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  4 роки тому

      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

  • @EngineerVaibhav
    @EngineerVaibhav Рік тому +2

    157 video completed❤🎉

  • @jayantaghosh7678
    @jayantaghosh7678 3 роки тому +1

    He is GOD of Core Java

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  3 роки тому

      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

  • @Prakash-8876
    @Prakash-8876 2 роки тому +1

    Thank you God 🙏🏻

  • @priyankatiwari-ly8gf
    @priyankatiwari-ly8gf 3 роки тому +1

    Awesome explanation...thank u so much Sir

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  3 роки тому

      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

  • @harshadsamant244
    @harshadsamant244 5 років тому +2

    God bless you

  • @haykmkrtchyan7093
    @haykmkrtchyan7093 8 місяців тому +1

    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.

  • @Lakshmankablog
    @Lakshmankablog 2 роки тому +1

    👏👌🐎🥳

  • @sanketatmaram
    @sanketatmaram 4 роки тому +1

    Thanks Sir

  • @shanashafkat2247
    @shanashafkat2247 6 років тому +2

    Sir, you are great 👍

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  6 років тому

      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

  • @sahil_dwivedi
    @sahil_dwivedi 4 роки тому +1

    God 🙏 of Java

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  4 роки тому

      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

  • @राजनगोंगल
    @राजनगोंगल Рік тому +1

    👍👍👍👍👍👍🙏🙏🙏🙏🙏🙏👏👏👏👏👏👏

  • @vijaymaddhesiya6865
    @vijaymaddhesiya6865 7 років тому

    Very useful tutorial....thanks sir

  • @nitskrishna
    @nitskrishna 7 років тому

    Best explanation sir.

  • @MunniDivya
    @MunniDivya 6 років тому +1

    great

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  6 років тому

      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

  • @munaswamy6595
    @munaswamy6595 4 роки тому +1

    Please explain realtime example for hasmap and ConcarentHashmap

  • @yugalchaudhari4473
    @yugalchaudhari4473 3 роки тому +1

    You explained ConcurrentHashMap very well. Thank you sir.

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  3 роки тому

      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

  • @parmodprajapati
    @parmodprajapati 5 років тому +1

    Sir can you explain with example with thread etc

  • @chetankhandave
    @chetankhandave 5 років тому +2

    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.

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  5 років тому

      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

  • @zeliofern
    @zeliofern 6 років тому +3

    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.

  • @krishnarohit3166
    @krishnarohit3166 4 роки тому +1

    god of java

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  4 роки тому

      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

  • @samadhanjadhav3690
    @samadhanjadhav3690 3 роки тому +1

    Can in one segment update operation perform parralely or not ?

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  3 роки тому

      Hello Samadhan.
      Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28

  • @amitkumargupta4200
    @amitkumargupta4200 8 років тому +2

    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?

    • @prabhudeepsingh4236
      @prabhudeepsingh4236 8 років тому

      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.

    • @Ashish94711
      @Ashish94711 7 років тому

      Amitkumar Gupta It can happen and that is why concurrent hashmap is not automic and u can not rely on contains method of this.

    • @john_rambo_27098
      @john_rambo_27098 7 років тому +1

      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.

  • @shibaadak
    @shibaadak 6 років тому

    Sir, I am big fan of you. I want to know why null is not allowed in Hashtable or in ConcurrentHashMap?

  • @avinashtripathi139
    @avinashtripathi139 3 роки тому +1

    Does this playlist have DSA part?

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  3 роки тому

      Hello Avinash.
      Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28

  • @anirudhgadari
    @anirudhgadari 3 роки тому +1

    What is the real time usage where we want to use concurrent hash map

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  3 роки тому

      Hello Anirudh.
      Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28

  • @amol28kulkarni
    @amol28kulkarni 8 років тому

    concurrent Hashmap is implemented with hashtable so multiple hashtable are created but does hashtable not block read operation

  • @half_demon1466
    @half_demon1466 5 років тому +2

    Could anyone help me with what is segment and bucket here?

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  5 років тому

      Hello Ashish.
      Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28

  • @vijaykorke8837
    @vijaykorke8837 3 місяці тому +1

    done today, 18, OCT, 2024 12:05 AM

  • @nandkishorsharma2498
    @nandkishorsharma2498 7 років тому

    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.

    • @swatirupnar9996
      @swatirupnar9996 6 років тому +2

      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.

  • @baijayantisahoo2378
    @baijayantisahoo2378 8 років тому

    Pls tell why ConcurrentHashMap doesnt throw ConcurrentModificationException ?

    • @john_rambo_27098
      @john_rambo_27098 7 років тому

      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.

  • @rajaseemon
    @rajaseemon 2 роки тому +1

    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?

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  2 роки тому

      Hello Friend.
      Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28

  • @narsimhapardhu6541
    @narsimhapardhu6541 5 років тому +1

    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;
    }

    • @DurgaSoftwareSolutions
      @DurgaSoftwareSolutions  5 років тому

      Hello Narsimha.
      Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28

  • @manasdalai1892
    @manasdalai1892 8 років тому

    Sir, Can you please explain how we can provide lock at bucket level?

  • @sourabhchhabra
    @sourabhchhabra 7 років тому

    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.

    • @ankushdureja6583
      @ankushdureja6583 7 років тому

      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.