Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-1845

Multi-threaded solving shutdown performance: destroy operation should first clear the operation queue

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Do
    • Icon: Major Major
    • 7.37.0.Final
    • None
    • optaplanner-core
    • None
    • 2020 Week 07-09 (from Feb 10), 2020 Week 10-12 (from Mar 2), 2020 Week 13-15 (from Mar 23), 2020 Week 16-18 (from Apr 13)
    • 2
    • NEW
    • NEW

      In MultiThreadedConstructionHeuristicDecider and MultiThreadedLocalSearchDecider there is this code:

      // Tell the move thread runners to stop
              DestroyOperation<Solution_> destroyOperation = new DestroyOperation<>();
              for (int i = 0; i < moveThreadCount; i++) {
                  operationQueue.add(destroyOperation);
              }
      

      That could probably first do this, to improve shutdown performance:

      operationQueue.clear();
      

      That will clear the non-started MoveOperations. It will also clear the non-started StepOperations. Because this is a poison-pill, that's fine.

              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: