Multithreading
- 26 November
ConcurrentHashMap in java
ConcurrentHashMap was introduced in Java 5 with other concurrency utils such as CountDownLatch, CyclicBarrier and BlockingQueue. ConcurrentHashMap in java is very similar to HashTable but it provides better concurrency level. You might know , you can synchonize HashMap using Collections.synchronizedMap(Map). So what is difference between ConcurrentHashMap and Collections.synchronizedMap(Map)In case of Collections.synchronizedMap(Map), it locks whole HashTable […]
- 11 July
Difference between sleep and wait in java
One of the common interview question is “What is difference between sleep and wait in java”.Before we actually see differences,let me give you brief introduction of both. sleep It causes current executing thread to sleep for specific amount of time. Its accuracy depends on system timers and schedulers. It keeps the monitors it has acquired, […]