Re: jmx-dev RFR: 8185005: Improve performance of ThreadMXBean.getThreadInfo(long ids[], int maxDepth)

2019-09-19 Thread serguei.spit...@oracle.com
Hi Daniil, I think, it is better to grab the thread_lock just once at lazy initialization. It would look simpler, something, like this would work: void ThreadTable::lazy_initialize(const ThreadsList *threads) { if (_is_initialized) { return;

Re: jmx-dev RFR: 8185005: Improve performance of ThreadMXBean.getThreadInfo(long ids[], int maxDepth)

2019-09-19 Thread David Holmes
On 20/09/2019 12:54 pm, Daniil Titov wrote: Hi David, Thank you for reviewing this version of the fix. I agree with previous comments about the general race with is_exiting in terms of how this API behaves. But there's no change in that behaviour with your changes AFAICS. Could y

Re: jmx-dev RFR: 8185005: Improve performance of ThreadMXBean.getThreadInfo(long ids[], int maxDepth)

2019-09-19 Thread Daniil Titov
Hi David, Thank you for reviewing this version of the fix. >I agree with previous comments about the general race with is_exiting in >terms of how this API behaves. But there's no change in that behaviour >with your changes AFAICS. Could you please say am I right that you are refer

Re: jmx-dev RFR: 8185005: Improve performance of ThreadMXBean.getThreadInfo(long ids[], int maxDepth)

2019-09-19 Thread David Holmes
Hi Daniil, On 20/09/2019 10:30 am, Daniil Titov wrote: Hi David and Serguei, Please review new version of the fix that includes the changes Serguei suggested: 1. If racing threads initialize the thread table only one of these threads will populate the table with the threads from the thread

Re: jmx-dev RFR: 8185005: Improve performance of ThreadMXBean.getThreadInfo(long ids[], int maxDepth)

2019-09-19 Thread Daniil Titov
Hi David and Serguei, Please review new version of the fix that includes the changes Serguei suggested: 1. If racing threads initialize the thread table only one of these threads will populate the table with the threads from the thread list 2. The code that adds the thread to the tread table