Why concurrenthashmap is fail safe?
Answer / Shivendra Pal Singh
ConcurrentHashMap in Java is designed to be thread-safe, allowing multiple threads to perform operations simultaneously without causing conflicts. It achieves this by using locks and segments for internal synchronization, ensuring that no two threads access the same bucket at the same time. This makes ConcurrentHashMap a fail-fast iterator (meaning it will throw ConcurrentModificationException if its structure is modified during iteration).
| Is This Answer Correct ? | 0 Yes | 0 No |
What is an expression tree?
What is difference between array and arraylist?
How can you correct these errors?
What is the difference between Strings and Arrays?
How to inverting a function in sort and searching?
How is it possible to insert different type of elements in stack?
What is Insertion sort, selection sort, bubble sort( basic differences among the functionality of the three sorts and not the exact algorithms)?
why it is difficult to store linked list as an array?
What does arrays tostring do?
What are different types of sorting algorithms?
How can I learn data structures?
Briefly explain recursive algorithm?