Hi,
I am using a third party library to do hand evaluation of 7 card poker hands. The method evaluate
in this library is declared as public static and I believe it alters some global static arrays within the class. The problem I have is that as I am doing an enumeration algorithm of about 10m enumerations I want to parallelize it, therefore I created FutureTasks which each which evaluate a fraction of the 10m evaluations. The error I am getting is:
java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: -2147483648
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
Which from what I gather from Google searches is caused when attempting to retrieve the result of a task that aborted by throwing an exception.
Is there some way to make this static method thread safe, like each thread making a its own copy of the global static arrays that are being edited?
Thanks