Understanding Thread Dump
I have Spring Boot 3 application which recently stops being responsive after few hours of uptime, I took a thread dump and all of ForkJoinPool.commonPool-worker stack trace look like this
Managing multiple exclusive locks for a set of unique values
Consider I have a number of string values (dynamically generated), and a thread pool, and I want each string value to be exclusively owned by at most a single thread at any time. So, for instance, if the string “foo” is locked by a thread T1 at some period in time, all other threads waiting to process “foo” (or any other string equal to “foo” in terms of Object.equals()
) must wait until thread T1 releases the lock.
How to implement ThreadLocal?
I want to have a ThreadLocal
of an implementor of AutoCloseable
. I can’t find some kind of hook where I can ensure close()
is called when the thread dies.
Why are my Java multi-thread I/O slower than sequential?
While testing thread creation/parallel processing, I met this strange situation where the multi-thread code is much slower than sequential version.
Does Java Object class contain a collection for keeping track of threads waiting on them?
How exactly is wait()
and notify()
implemented in Java?
Does Java Object class contains a collection for keeping track of threads waiting on them?
How exactly wait() and notify() is implemented in Java ? When a thread calls wait() on an object , does object store the thread into a collection within the object? so that when notify() is called it can wake up the thread waiting on it
Does Java Object class contains a collection for keeping track of threads waiting on them?
How exactly wait() and notify() is implemented in Java ? When a thread calls wait() on an object , does object store the thread into a collection within the object? so that when notify() is called it can wake up the thread waiting on it
Java 22.0.2 VirtualThread unparker seems parked forever
When I use following threadpool with heavy load.
Main thread or sub thread responsibility
when a class extends thread class, having methods other than run() then which thread is responsible to execute the methods whether main thread or sub thread created for that class?
Execute an instance of Thread in an ExecutorService
I know we can execute Runnables in an ExecutorService which will be executed as separate threads. But I recently came across a situation where I need to know the state of a Thread during its executions. For that I created instances of Threads (instead of Runnable) and submitted it to an ExecutorService. However, the Thread state remained in NEW state. Syntactically the program had no errors but I feel I am missing something. Here is the sample program: