Concurrency

Java Concurrency Interview Questions

Java concurrency interview guide lists frequently asked questions for beginners and experienced programmers to help refresh multi-threading concepts.

Java ExecutorService Shutdown: shutdown() vs shutdownNow()

Shut down a Java ExecutorService with shutdown(), awaitTermination() and shutdownNow(), or with try-with-resources and close() on Java 19+. Covers queued tasks, RejectedExecutionException, virtual threads, JVM exit and shutdown hooks.

Java Lock and ReentrantLock Tutorial with Examples

Use a Java Lock to let one thread at a time change shared data. Covers ReentrantLock with try-finally, tryLock() with a timeout, fair locks, ReadWriteLock, StampedLock, Condition and virtual threads.

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.