Reputation: 359
In applications where I use threads I usually create them, I start them and wait for them to end up using the join method. I observe that there is a time when the main process is inactive and I do not know the reason. In the attached graphic it can be verified that there are four threads working and the main thread presents a time of inactivity. It's represented in violet in the next graphic:
Why does that downtime appear? Thank you
Upvotes: 1
Views: 902
Reputation: 1397
I edited and compiled your example and wrote JFR. In JMC I see the same as in any other multithreaded java application. So I think the problem is in profiler tool. May be it stops main thread in unusual way for monitoring purposes. May be it is just wrong. Use Oracle Java Mission Control. This tool have to be right.
Upvotes: 2