I am using a library (written in C) that is not reentrant (i.e. no function in the library exists). Suppose I loaded the library through System.load to get the descriptor "v". I cannot use v in two threads due to reload problems (verified but meaningless results). I could use locks, but that defeats any parallelism I could get.
What I would like to do is start two threads, and in each thread load the library to get two different handles (there are two copies of the loaded library).
Is this possible in Java? Regards Saptarshi
Capsi source share