• Categories
    • Recent
    • Tags
    • Popular
    • Register
    • Login

    Synchronization between rules and timer handlers

    Scheduled Pinned Locked Moved General Discussion
    6 Posts 2 Posters 2.1k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B Offline
      benya
      last edited by benya

      How does MyController handle rules and timers?
      Do they execute operations from concurrent threads?
      Should we worry about synchronization when scripts read/write repository variables?

      Or all scripts are executed by a single thread and there are no concurrency issues?

      jkandasaJ 1 Reply Last reply Reply Quote 0
      • jkandasaJ Offline
        jkandasa @benya
        last edited by

        @benya Rules and timers are running on different threads. When you fetch repository variable, it becomes your local reference, If you do change it will override existing value.

        B 1 Reply Last reply Reply Quote 0
        • B Offline
          benya @jkandasa
          last edited by

          @jkandasa We need some mechanism to prevent race condition.

          1 Reply Last reply Reply Quote 1
          • B Offline
            benya
            last edited by

            Is any <String, Object> map accessible to Groovy scripts?
            It would be possible to store there generic objects and use them for synchronization.

            jkandasaJ 1 Reply Last reply Reply Quote 0
            • jkandasaJ Offline
              jkandasa @benya
              last edited by

              @benya Do you face any issue with out Synchronization?

              B 1 Reply Last reply Reply Quote 0
              • B Offline
                benya @jkandasa
                last edited by

                @jkandasa said:

                @benya Do you face any issue with out Synchronization?

                I face potential issue in the following scenario:

                • multiple PIRs tigger rule that reads/writes global variable and disables/enables timer
                • timer reads global variable as well
                • timer has counter=1 and self-disables when triggered

                Therefore I need to synchronize access to the global variable and modifications of timer object.
                Otherwise global variable and timer could be left in an unexpected state.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post

                0

                Online

                587

                Users

                529

                Topics

                3.4k

                Posts
                Copyright © 2015-2025 MyController.org | Contributors | Localization