> This PR adds ranked monitor support to the debug agent. The debug agent has a
> large number of monitors, and it's really hard to know which order to grab
> them in, and for that matter which monitors might already be held at any
> given moment. By imposing a rank on each monitor, we can check
On Mon, 6 May 2024 21:42:10 GMT, Chris Plummer wrote:
>> I don't see how that helps. Access to the field is not protected.
>
> I guess there could be a race if one thread is destroying this monitor while
> another is trying to use it. Thus a thread could be doing something like a
> RawMonitorEn
On Thu, 9 May 2024 21:40:42 GMT, David Holmes wrote:
>> I guess there could be a race if one thread is destroying this monitor while
>> another is trying to use it. Thus a thread could be doing something like a
>> RawMonitorEnter in the middle of (or after) the monitor being destroyed.
>> Fixi
On Mon, 13 May 2024 18:32:45 GMT, Chris Plummer wrote:
>> FWIW Deleting monitors is a tricky business and needs to be done with great
>> care. You have to ensure all threads using the monitor are completely done
>> with it. Simply locking it first to check it is "unused" is not sufficient.
>
>
On Mon, 13 May 2024 21:47:32 GMT, Alex Menkov wrote:
> If debugger attaches to the debuggee, detaches and re-attaches again, are the
> monitors recreated again?
> (with rankedMonitor you added an assert if `DebugRawMonitor::monitor` is not
> null)
Almost all of the debugMonitorCreate() calls s
On Thu, 9 May 2024 06:10:04 GMT, Chris Plummer wrote:
>> This PR adds ranked monitor support to the debug agent. The debug agent has
>> a large number of monitors, and it's really hard to know which order to grab
>> them in, and for that matter which monitors might already be held at any
>> gi
On Fri, 17 May 2024 20:03:11 GMT, Alex Menkov wrote:
>> Chris Plummer has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Flip rank order. Some cleanup and better comments for verifyMonitorRank().
>
> src/jdk.jdwp.agent/share/native/libjdwp/
On Fri, 17 May 2024 20:03:11 GMT, Alex Menkov wrote:
>> Chris Plummer has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Flip rank order. Some cleanup and better comments for verifyMonitorRank().
>
> src/jdk.jdwp.agent/share/native/libjdwp/