title: Java: Load the same dynamic library in two threads (both threads in the same JVM)
body: <p>I am using a library (written in C) that is not reentrant(i.e no function in the library is reentrant). Suppose I have loaded the library via System.load to get the handle say 'v'. I cannot use v in two threads because of the reentrancy issues (tried but nonsense results). I could use locks, but that defeats any parallelism i could have gained.</p>
  
  <p>What I'd like to do is start two threads, and in each thread load the library to get two different handles(thus there are two copies of the loaded library).</p>
  
  <p>Is this possible in Java?
  Regards
  Saptarshi</p>