Search code examples
javaprocessbatch-filethreadpool

Simulation threads conflict even when started by different processes


I have a code base that deals with simulation of certain data. It involves lot of threads and lot of complications.

I just tried using that base as jar and ran multiple simulations through a batch file like below.

start java-cp base.jar; Sim1.java
start java-cp base.jar; Sim2.java
start java-cp base.jar; Sim3.java

I get interrupted exceptions since the code base contain simulation code that has lot of holds and waits.

I want to know whether using the same jar creates the conflict. How to solve this problem?


Solution

  • There was a lock on a file. I was trying to use the same file in multiple process. Thanks Hiro2k.