Index: trunk/sources/HeuristicLab.Operators/3.3/Operator.cs
===================================================================
--- trunk/sources/HeuristicLab.Operators/3.3/Operator.cs	(revision 5163)
+++ trunk/sources/HeuristicLab.Operators/3.3/Operator.cs	(revision 5193)
@@ -22,4 +22,5 @@
 using System;
 using System.Drawing;
+using System.Threading;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -28,5 +29,5 @@
 namespace HeuristicLab.Operators {
   /// <summary>
-  /// The base class for all operators.
+  /// Base class for operators.
   /// </summary>
   [Item("Operator", "Base class for operators.")]
@@ -43,35 +44,20 @@
     }
 
-    [Storable]
-    private IExecutionContext executionContext;
+    private Lazy<ThreadLocal<IExecutionContext>> executionContexts;
     protected IExecutionContext ExecutionContext {
-      get { return executionContext; }
+      get { return executionContexts.Value.Value; }
       private set {
-        if (value != executionContext) {
-          executionContext = value;
-          OnExecutionContextChanged();
+        if (value != executionContexts.Value.Value) {
+          executionContexts.Value.Value = value;
         }
       }
     }
-
-    /// <summary>
-    /// Flag whether the current instance has been canceled.
-    /// </summary>
-    private bool canceled;
-    /// <inheritdoc/>
-    protected bool Canceled {
-      get { return canceled; }
-      private set {
-        if (value != canceled) {
-          canceled = value;
-          OnCanceledChanged();
-        }
-      }
+    private CancellationToken cancellationToken;
+    protected CancellationToken CancellationToken {
+      get { return cancellationToken; }
     }
 
     [Storable]
     private bool breakpoint;
-    /// <inheritdoc/>
-    /// <remarks>Calls <see cref="OnBreakpointChanged"/> in the setter.</remarks>
     public bool Breakpoint {
       get { return breakpoint; }
@@ -86,46 +72,43 @@
 
     [StorableConstructor]
-    protected Operator(bool deserializing) : base(deserializing) { }
+    protected Operator(bool deserializing)
+      : base(deserializing) {
+      executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);
+    }
     protected Operator(Operator original, Cloner cloner)
       : base(original, cloner) {
-      this.canceled = original.canceled;
+      executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);
       this.breakpoint = original.breakpoint;
-      this.executionContext = cloner.Clone<IExecutionContext>(original.executionContext);
     }
-    /// <summary>
-    /// Initializes a new instance of <see cref="OperatorBase"/> setting the breakpoint flag and 
-    /// the canceled flag to <c>false</c> and the name of the operator to the type name. 
-    /// </summary>
     protected Operator()
       : base() {
-      canceled = false;
+      executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);
       breakpoint = false;
     }
     protected Operator(string name)
       : base(name) {
-      canceled = false;
+      executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);
       breakpoint = false;
     }
     protected Operator(string name, ParameterCollection parameters)
       : base(name, parameters) {
-      canceled = false;
+      executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);
       breakpoint = false;
     }
     protected Operator(string name, string description)
       : base(name, description) {
-      canceled = false;
+      executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);
       breakpoint = false;
     }
     protected Operator(string name, string description, ParameterCollection parameters)
       : base(name, description, parameters) {
-      canceled = false;
+      executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);
       breakpoint = false;
     }
 
-    /// <inheritdoc/>
-    public virtual IOperation Execute(IExecutionContext context) {
+    public virtual IOperation Execute(IExecutionContext context, CancellationToken cancellationToken) {
       try {
-        Canceled = false;
         ExecutionContext = context;
+        this.cancellationToken = cancellationToken;
         foreach (IParameter param in Parameters)
           param.ExecutionContext = context;
@@ -140,23 +123,7 @@
       }
     }
-    /// <inheritdoc/>
-    /// <remarks>Sets property <see cref="Canceled"/> to <c>true</c>.</remarks>
-    public void Abort() {
-      Canceled = true;
-    }
-    /// <summary>
-    /// Performs the current operator on the specified <paramref name="scope"/>.
-    /// </summary>
-    /// <param name="scope">The scope where to execute the operator</param>
-    /// <returns><c>null</c>.</returns>
     public abstract IOperation Apply();
 
-    protected virtual void OnExecutionContextChanged() { }
-    protected virtual void OnCanceledChanged() { }
-    /// <inheritdoc/>
     public event EventHandler BreakpointChanged;
-    /// <summary>
-    /// Fires a new <c>BreakpointChanged</c> event.
-    /// </summary>
     protected virtual void OnBreakpointChanged() {
       if (BreakpointChanged != null) {
@@ -164,9 +131,5 @@
       }
     }
-    /// <inheritdoc/>
     public event EventHandler Executed;
-    /// <summary>
-    /// Fires a new <c>Executed</c> event.
-    /// </summary>
     protected virtual void OnExecuted() {
       if (Executed != null) {
