Java parallel work iterator?
问题 I'm looking for a class where I can override a method to do the work, and return the results like an iterator. Something like this: ParallelWorkIterator<Result> itr = new ParallelWorkIterator<Result>(trials,threads) { public Result work() { //do work here for a single trial... return answer; } }; while (itr.hasNext()) { Result result = itr.next(); //process result... } This is mainly going to be used for things like monte carlo simulations, but I don't want to have to deal with setting up