Multithreading and Concurrency

Multi-threading and Concurrency related collection

Java 8 Parallel Stream with ThreadPool

Carvia Tech | December 26, 2019 | 2 min read | 1,727 views | Multithreading and Concurrency

Configure thread pool for Java 8 parallel stream operations - configure default common pool and running parallel stream operation inside ForkJoinPool.

Read Article

Removing elements while iterating over a Java Collection

Carvia Tech | December 16, 2019 | 2 min read | 561 views | Multithreading and Concurrency

It is not generally permissible for one thread to modify a Collection while another thread is iterating over it. In general, the results of the iteration are undefined under these circumstances.

Read Article

Java Concurrency Interview Questions and Answers

Carvia Tech | December 12, 2019 | 2 min read | 514 views | Multithreading and Concurrency

top java concurrency and multi-threading interview questions - Java Memory Model, volatile keyword, HashMap, ConcurrentHashMap, fail-safe and fail-fast iterator, immutability, ThreadLocal, Callable and Runnable

Read Article

What is Immutable Class in Java

Carvia Tech | December 08, 2019 | 2 min read | 717 views | Multithreading and Concurrency

An object is called Immutable when its state can not be changed after its construction. Immutable objects are inherently thread-safe, thus making it easy to write multi-threading code

Read Article

What is does Collections.unmodifiableCollection do

Carvia Tech | December 04, 2019 | 1 min read | 20 views | Multithreading and Concurrency

What does Collections.unmodifiableCollection() do? Is it safe to use the collection returned by this method in a multi-threading environment?

Read Article

What is difference between Callable and Runnable Interface?

Carvia Tech | December 03, 2019 | 2 min read | 815 views | Multithreading and Concurrency

Callable interface is similar to Runnable, in that both are designed for classes whose instances are potentially executed by another thread. A Runnable, however, does not return a result and cannot throw a checked exception.

Read Article

Producer Consumer Problem using Blocking Queue in Java

Carvia Tech | August 31, 2019 | 3 min read | 1,489 views | Multithreading and Concurrency

A producer consumer problem is a typical example of multi-thread synchronization problem where some shared resource (a work queue, blockingqueue) is used by two types of threads - Producer & Consumer

Read Article

Can the keys in HashMap be mutable

Carvia Tech | August 03, 2019 | 2 min read | 1,216 views | Multithreading and Concurrency

Simple answer is No, If we make the keys mutable then the hashcode of the key will no more be consistent over time which will cause lookup failure for that object from hashing data structure

Read Article

What is AtomicInteger class and how it works internally

Carvia Tech | August 03, 2019 | 2 min read | 963 views | Multithreading and Concurrency

AtomicInteger class was added in Java 5 that utilizes non-blocking concurrency for thread-safety, providing better throughput in highly concurrent environments.

Read Article

Discuss internals of a ConcurrentHashmap (CHM) in Java

Carvia Tech | May 25, 2019 | 4 min read | 2,169 views | Multithreading and Concurrency

A ConcurrentHashMap is a hashmap supporting full concurrency of retrieval via volatile reads of segments and tables without locking, and adjustable expected concurrency for updates. All the operations in this class are thread-safe.

Read Article

This website uses cookies to ensure you get the best experience on our website. more info