Showing results 1 to 1 of 1

Thread: ThreadSafety OnlineContainer

  1. #1
    Join Date
    15.12.2017
    Posts
    3

    Default ThreadSafety OnlineContainer

    Ich habe mir das Beispiel zu VariableSubscription aus https://github.com/copa-data angesehen. Bei einer Änderung der Variablen wird folgender Handler aufgerufen:

    Code:
    private void Container_BulkChanged(object sender, BulkChangedEventArgs e)
    {
      try
      {
        // Do not execute long-running processes here. They are blocking the
        // main thread of zenon. Therefore we use the TPL (Task Parallel Library) to run the 
        // Action as separate thread
        _logger.Info("Bulk update received.");
        Task.Factory.StartNew(() => _variableChangeReceivedAction(e.Variables));
      }
      catch (Exception exception)
      {
        _logger.Error(exception);
      }
    }
    Liefert BulkChangedEventArgs
    ein immutable-Objekt oder eine Kopie der Variablen zurück damit diese bei der Verarbeitung (im Verarbeitungs-Thread) vom UI-Thread aus nicht verändert werden?
    Last edited by evyma : 26th December 2017 at 10:31 Reason: Formattierung

Similar Threads

  1. OnlineContainer ActivateBulkMode
    By evyma in forum Add-In Framework
    Replies: 2
    Last Post: 20th December 2017, 13:54
  2. Replies: 7
    Last Post: 30th October 2013, 14:53
  3. Replies: 17
    Last Post: 11th July 2013, 13:08
  4. Replies: 5
    Last Post: 12th January 2011, 11:06
  5. Replies: 5
    Last Post: 16th July 2009, 14:39

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •