Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13251


Ignore:
Timestamp:
11/18/15 13:55:01 (8 years ago)
Author:
mkommend
Message:

#2442: Adapted locking in the symbolic expression trees interpreters when incrementing the evaluated solutions.

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs

    r13248 r13251  
    117117    public void ClearState() { }
    118118
     119    private readonly object syncRoot = new object();
    119120    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows) {
    120121      if (CheckExpressionsWithIntervalArithmetic)
    121122        throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter.");
    122123
    123       lock (EvaluatedSolutionsParameter.Value) {
     124      lock (syncRoot) {
    124125        EvaluatedSolutions++; // increment the evaluated solutions counter
    125126      }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs

    r13248 r13251  
    150150    #endregion
    151151
     152    private readonly object syncRoot = new object();
    152153    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows) {
    153154      if (CheckExpressionsWithIntervalArithmetic)
    154155        throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter.");
    155156
    156       EvaluatedSolutions++; // increment the evaluated solutions counter
     157      lock (syncRoot) {
     158        EvaluatedSolutions++; // increment the evaluated solutions counter
     159      }
    157160      var state = PrepareInterpreterState(tree, dataset);
    158161
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs

    r13248 r13251  
    7272
    7373    protected SymbolicDataAnalysisExpressionTreeInterpreter(SymbolicDataAnalysisExpressionTreeInterpreter original,
    74       Cloner cloner) : base(original, cloner) { }
     74      Cloner cloner)
     75      : base(original, cloner) { }
    7576
    7677    public override IDeepCloneable Clone(Cloner cloner) {
     
    116117    #endregion
    117118
     119    private readonly object syncRoot = new object();
    118120    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset,
    119121      IEnumerable<int> rows) {
     
    122124      }
    123125
    124       lock (EvaluatedSolutionsParameter.Value) {
     126      lock (syncRoot) {
    125127        EvaluatedSolutions++; // increment the evaluated solutions counter
    126128      }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs

    r13248 r13251  
    123123    #endregion
    124124
     125    private readonly object syncRoot = new object();
    125126    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows) {
    126127      if (CheckExpressionsWithIntervalArithmetic)
    127128        throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter.");
    128129
    129       lock (EvaluatedSolutionsParameter.Value) {
     130      lock (syncRoot) {
    130131        EvaluatedSolutions++; // increment the evaluated solutions counter
    131132      }
Note: See TracChangeset for help on using the changeset viewer.