Closed mdabros closed 4 years ago
@mdabros you need to use ConcurrentQueue
this is FIFO. :) Bag is as you say unordered and should only be used in those cases where that is ok. Otherwise, ConcurrentQueue FIFO, or ConcurrentStack FILO, haven't checked your code though.
Running the
RandomSearchOptimizer
withrunPrallel=false
, so not multithreading, with 100 iterations and 120 iterations seem to provide different order of results. Expectation would be that the fist 100 iteration would be the same, and this is not currently the case. This is most likely caused by the use ofConcurrentBag
to collect the results, which does not guarantee order.This might also affect other Optimizers supporting parallel execution,