Re: RFR: 8266310: deadlock while loading the JNI code [v2]

2021-05-21 Thread Aleksei Voitylov
Peter, David, I updated the PR to focus on solving the problem I originally intended to solve that is observed in the wild - a deadlock when two different libraries are being loaded. The case when the same library JNI_OnLoad has FindClass with a circular dependency on loading the same library is

Re: RFR: 8266310: deadlock while loading the JNI code [v2]

2021-05-21 Thread Peter Levart
On 21/05/2021 10:29, Peter Levart wrote: I still haven't found a scenario of a possible deadlock when Sergei's initial patch is combined with... Sorry Aleksei, I renamed you to Sergei without intention. Please excuse me. Peter

Re: RFR: 8266310: deadlock while loading the JNI code [v2]

2021-05-21 Thread Peter Levart
On 21/05/2021 01:11, David Holmes wrote: Hi Peter, On 21/05/2021 12:42 am, Peter Levart wrote: Hi Aleksei, Are you trying to solve this in principle or do you have a concrete problem at hand which triggers this deadlock? If it is the later, then some rearrangement of code might do the

Re: RFR: 8266310: deadlock while loading the JNI code [v2]

2021-05-20 Thread David Holmes
Hi Peter, On 21/05/2021 12:42 am, Peter Levart wrote: Hi Aleksei, Are you trying to solve this in principle or do you have a concrete problem at hand which triggers this deadlock? If it is the later, then some rearrangement of code might do the trick... For example, native libraries are

Re: RFR: 8266310: deadlock while loading the JNI code [v2]

2021-05-20 Thread Peter Levart
Hi Aleksei, Are you trying to solve this in principle or do you have a concrete problem at hand which triggers this deadlock? If it is the later, then some rearrangement of code might do the trick... For example, native libraries are typically loaded by a class initializer of some class that

Re: RFR: 8266310: deadlock while loading the JNI code [v2]

2021-05-19 Thread David Holmes
On 20/05/2021 2:29 am, Aleksei Voitylov wrote: On Wed, 19 May 2021 16:21:41 GMT, Aleksei Voitylov wrote: Please review this PR which fixes the deadlock in ClassLoader between the two lock objects - a lock object associated with the class being loaded, and the ClassLoader.loadedLibraryNames

Re: RFR: 8266310: deadlock while loading the JNI code [v2]

2021-05-19 Thread Aleksei Voitylov
On Wed, 19 May 2021 16:21:41 GMT, Aleksei Voitylov wrote: >> Please review this PR which fixes the deadlock in ClassLoader between the >> two lock objects - a lock object associated with the class being loaded, and >> the ClassLoader.loadedLibraryNames hash map, locked during the native >>

Re: RFR: 8266310: deadlock while loading the JNI code [v2]

2021-05-19 Thread Aleksei Voitylov
> Please review this PR which fixes the deadlock in ClassLoader between the two > lock objects - a lock object associated with the class being loaded, and the > ClassLoader.loadedLibraryNames hash map, locked during the native library > load operation. > > Problem being fixed: > > The initial