Java Concurrent Collections: ConcurrentHashMap and BlockingQueues

preview_player
Показать описание
This video describes the structure and functionality of the Java ConcurrentHashMap and BlockingQueue concurrent collections.
Рекомендации по теме
Комментарии
Автор

An amazing lecture, exactly what I needed, but I feel obligated to point out one possibly confusing thing: 1:48
The way you explain hash function suggest it's random while it has nothing to do with randomness (neither true nor pseudo) since hash function for a given key must always return the same result- it's perfectly deterministic.

karolbielen
Автор

Thanks Prof Doug for updating your course with ConcurrentHashMap implementation details. I think this is something newly added.
I had the impression that changes in ConcurrentHashMap are visible to all the readers.
In the get() API, if the key is not found, then a lock is eventually taken  and so the readers will  see the newly added key.Also as you said, the value field is volatile so, readers will see the changes in values immediately.
I think, the iterators created before the update might miss the newly added keys, but if we create iterators after update, they will see all the changes made.
Please let me know if I am missing something.

SanjeevKumar-hjfb
Автор

Hi, In Java 8 CHM implementation has got changed. It does not use segments anymore. Could you please recheck.

Rahul-nkxw