Re: RFR: 8328866: Add raw monitor rank support to the debug agent. [v6]

2024-05-08 Thread Chris Plummer
> 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

Re: RFR: 8328866: Add raw monitor rank support to the debug agent. [v6]

2024-05-09 Thread David Holmes
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

Re: RFR: 8328866: Add raw monitor rank support to the debug agent. [v6]

2024-05-13 Thread Chris Plummer
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

Re: RFR: 8328866: Add raw monitor rank support to the debug agent. [v6]

2024-05-13 Thread Alex Menkov
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. > >

Re: RFR: 8328866: Add raw monitor rank support to the debug agent. [v6]

2024-05-13 Thread Chris Plummer
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

Re: RFR: 8328866: Add raw monitor rank support to the debug agent. [v6]

2024-05-17 Thread Alex Menkov
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

Re: RFR: 8328866: Add raw monitor rank support to the debug agent. [v6]

2024-05-17 Thread Chris Plummer
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/

Re: RFR: 8328866: Add raw monitor rank support to the debug agent [v6]

2024-08-16 Thread Chris Plummer
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/