You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At present, the java-tron thread pool name is not clearly defined, a thread is created with the following (default) name: Thread[pool-1-thread-1], which isn’t helpful and doesn’t let you differentiate threads by name. As you can see, this isn't useful.
Some thread pools don't have a graceful shutdown.
What are the use-cases?
In case of performance issues: thread dumps and using the top command. In both cases, it’s useful to know what function does a thread service, as the stacktrace in the dump might not always be revealing.
A tool for quick investigation is top. More precisely, top -H -p . This shows the usual top table, but the -H flag means that threads for the chosen process should be printed. You basically get the most CPU-heavy and currently active threads, by name. In those cases, it’s extremely useful to have custom names.
All of these executors have a thread factory. It’s hidden in the default factory method, but you can supply a thread factory. If not supplied, a default thread factory is used whenever a thread is needed.
halibobo1205
changed the title
Organize all ThreadExecutors with explicit name and time-wait closure
Organize all ThreadExecutors with explicit name and time-wait shutdown
Aug 15, 2023
Rationale
Why should this feature exist?
thread pool
name is not clearly defined, a thread is created with the following (default) name: Thread[pool-1-thread-1], which isn’t helpful and doesn’t let you differentiate threads by name. As you can see, this isn't useful.What are the use-cases?
In case of performance issues: thread dumps and using the top command. In both cases, it’s useful to know what function does a thread service, as the stacktrace in the dump might not always be revealing.
A tool for quick investigation is top. More precisely, top -H -p . This shows the usual top table, but the -H flag means that threads for the chosen process should be printed. You basically get the most CPU-heavy and currently active threads, by name. In those cases, it’s extremely useful to have custom names.
Implementation
All of these executors have a thread factory. It’s hidden in the default factory method, but you can supply a thread factory. If not supplied, a default thread factory is used whenever a thread is needed.
Are you willing to implement this feature?
Yes.
The text was updated successfully, but these errors were encountered: