Multithreading and Concurrency

Multi-threading and Concurrency related collection

Top 20 Java Concurrency Interview Questions and Answers

Carvia Tech | May 28, 2019 | 1 min read | 23 views | Multithreading and Concurrency

We have compiled a list of top java concurrency and multi-threading interview questions.

Read Article

Producer Consumer Problem using Blocking Queue in Java

Carvia Tech | May 28, 2019 | 3 min read | 387 views | Multithreading and Concurrency

A producer consumer problem is a typical example of multi-thread synchronization problem. It describes a scenario where some shared resource (a work queue, blockingqueue) is used by two types of threads - Producers & Consumers.

Read Article

Discuss internals of a ConcurrentHashmap (CHM) in Java

Carvia Tech | May 25, 2019 | 4 min read | 239 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

What do you understand by Java Memory Model?

Carvia Tech | May 19, 2019 | 2 min read | 141 views | Multithreading and Concurrency

Java Memory Model defines the legal interaction of threads with the memory in a real computer system. It determines when a Thread can reliably see writes to variables made by other threads.

Read Article

What is AtomicInteger class and how it works internally

Carvia Tech | May 19, 2019 | 2 min read | 161 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

Design an Immutable class that has an java.util.Date member

Carvia Tech | May 19, 2019 | 1 min read | 42 views | Multithreading and Concurrency

As we know that java.util.Date is not immutable, we need to make a defensive copy of java.util.Date field while returning a reference to this instance variable.

Read Article

What is Immutable Class. Why would you choose it? How would you make a class immutable?

Carvia Tech | May 19, 2019 | 2 min read | 213 views | Multithreading and Concurrency

When the state of object can not be changed after its construction then the object is called Immutable. Immutable objects are inherently thread-safe, thus help writing multi-threading code without much worries.

Read Article

How will you handle ConcurrentModificationException in Java

Carvia Tech | May 06, 2019 | 1 min read | 19 views | Multithreading and Concurrency

ConcurrentModificationException is raised by fail-fast iterators when the underlying collection is modified structurally during iteration.

Read Article

What is ThreadLocal in Java, where will you use this class

Carvia Tech | May 05, 2019 | 4 min read | 38 views | Multithreading and Concurrency

ThreadLocal provides a mechanism of maintaining thread confinement for a given object. which allows you to associate a per-thread value with a value-holding object.

Read Article

What is difference between Callable and Runnable Interface?

Carvia Tech | May 05, 2019 | 2 min read | 161 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

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