Shareing file based counters between processes

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Shareing file based counters between processes

  • Creator
    Topic
  • #54633
    Roland Riepel
    Participant

      Hi all,

      Is there a way to share a file-based counter (the type created and used by the ctr* commands) between threads in different processes?

      Kind regards,

      Roland

    Viewing 3 reply threads
    • Author
      Replies
      • #82331
        James Cobane
        Participant

          Roland,

          Yes.  When you reference the counter, simply give it the full path to the counter file.  i.e.

          CtrNextValue /dirname/myCTR

          Hope this helps.

          Jim Cobane

          Henry Ford Health

        • #82332
          Russ Ross
          Participant

            James:

            Do you think this will cause contention when both threads make a call to access the shared counter file at the same time?

            Russ Ross
            RussRoss318@gmail.com

          • #82333
            James Cobane
            Participant

              There could be potential for contention as with any file-based activity.  That consideration should be evaluated as part of Roland’s design.

              Jim Cobane

              Henry Ford Health

            • #82334
              Rob Abbott
              Keymaster

                If you use the Ctr* commands they have locking built-in.  So contention should not be an issue.

                Rob Abbott
                Cloverleaf Emeritus

            Viewing 3 reply threads
            • The forum ‘Cloverleaf’ is closed to new topics and replies.