Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/05/15 10:19:37 (9 years ago)
Author:
abeham
Message:

#2174:

  • Removed compilation calls from the problem (AfterDeserialization and in cloning constructor) and instead compile instance lazily when accessed
  • Compile support code in ExternalEvaluationProblem lazy
  • Fixed encoding class names in template code files (forgot to add vector)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ProgrammableProblem/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/SingleObjectiveOptimizationSupportScript.cs

    r11893 r11900  
    6262    }
    6363
     64    private readonly object compileLock = new object();
    6465    private volatile ISingleObjectiveOptimizationSupport compiledInstance;
    6566    private ISingleObjectiveOptimizationSupport CompiledInstance {
    6667      get {
    67         if (compiledInstance == null) throw new InvalidOperationException("The problem definition script is not compiled and cannot be used.");
     68        if (compiledInstance == null) {
     69          lock (compileLock) {
     70            if (compiledInstance == null) {
     71              Compile();
     72            }
     73          }
     74        }
    6875        return compiledInstance;
    6976      }
Note: See TracChangeset for help on using the changeset viewer.