Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

What is Lock striping?

Pragya Keshap answered on February 6, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • package-lock what is it
  • What Is a Reentrant Lock?
  • What is Lock splitting technique?

  • What is Lock striping?

    0

    In Lock splitting we use different locks for different parts of the

    application. In Lock striping we use multiple locks to protect

    different parts of the same data structure.

    ConcurrentHashMap class of Java internally uses different buckets

    to store its values. Each bucket is chosen based on the value of key.

    ConcurrentHashMap uses different locks to guard different buckets.

    When one thread that tries to access a hash bucket, it can acquire the

    lock for that bucket. While another thread can simultaneously

    acquire lock for another bucket and access it. In a synchronized

    version of HashMap, the whole map is has one lock.

    Lock striping technique gives better performance than Synchronizing

    the whole data structure.

    https://www.geeksforgeeks.org/what-is-lock-striping-in-java-concurrency/

    Popularity 1/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Tags: whatever
    Link to this answer
    Share Copy Link
    Contributed on Feb 06 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.