Is it allowed to start a thread name with a digit?

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Is it allowed to start a thread name with a digit?

  • Creator
    Topic
  • #51374
    Robert Kersemakers
    Participant

      Hi all,

      Our Dutch reseller advised us to use a certain tcl-proc. When testing this, we immediately ran into errors. It now looks like this error only happens with thread names that start with a digit. The error is caused by the command ‘msiGetStatSample’:

      Code:

      hcitcl>msiAttach
      hcitcl>msiGetStatSample 2winqry2_prd
      Error: expected integer but got “2winqry2_prd”
      hcitcl>msiGetStatSample test_qry
      {ALIVE 1} {LASTEXTRACT 1259317889} {LASTUPDATE 1259316231} {START 1257178283} {STOP 0} <... ... ... ...> {NRCVD 0} {POSTXLTQD 0} {XLATETIME        0.000} {TIMEONQ        0.000}
      {TOTLATENCY        0.000}}}}
      hcitcl>msiGetStatSample getver
      Error: thread “getver” not found in region TOC
      hcitcl>

      We are on CL5.5 Rev 1 on HP-UX 11.23 ia64. Our reseller has confirmed the same error on CL5.7.

      We have been running threads that start with a digit for years, without any problems. Until now. Hence my question if it’s allowed to start thread names with a digit.

      Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

    Viewing 6 reply threads
    • Author
      Replies
      • #69933
        Jim Kosloskey
        Participant

          There are two ways documented to get the statsample.

          The first is by  getting a table of contents list using [msiTocEntry], then finding your thread name in that list and using the index of that thread name in that list in the msiGetStatSample command like this: msiGetStatSample $toc_index stats_kl where $toc_index is the index retrieved above.

          Or one can use the thread name directly in the msiGetStatSample Command by getting the thread name either from another source or from the Table of Contents. The msiGetStatSample command would look like this: msiGetStatSample >thread_namethread_name< is obtained however you want.

          However, there is a ‘bug’ and has been since 3.3.1 in msiStats wherein if the thread name starts with a numeric, the thread name is treated as if it is an index and method one is used by default. This raises an error as you have seen because the entire index is not numeric.

          I say ‘bug’ because in the stats documentation there is an indication that one is to use the facility at one’s own risk so this might just be the way it is.

          I do not use method two any longer, instead I use method one wherein even if I am given the thread name I look through the TOC list to get the index of that thread and I use the method one utilizing the index located. I avoid requiring threads not start with a numeric and still get the stats I want.

          I have a command line utility that dumps the msistats and that utility exploits this method. If you would like that proc, let me know via email.

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

        • #69934
          Gordon Koch
          Participant

            Hello Robert,

               Just to add my two cents here, we once ran into problems from the beginning with a thread and process name that started with a numeric. Since this was still in the testing phase, the names were changed to all alphas. Since you stated you have run fine with this thread in question, there must have factors involved (or the process name was the main culprit).

            Gordon

          • #69935
            Robert Kersemakers
            Participant

              Jim, thanks for clearing that up. I will use this information to notify our reseller.

              Gordon, as stated before: we never had problems with threads whose names started with a numeric. But our reseller did a site check recently and advised us to use a proc ‘gc_killMsgIfDestDown’ in several threads. And this proc uses the msiGetStatSample command. So that’s how we ran into this problem.

              Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

            • #69936
              David Burks
              Participant

                Robert, I would like to investigate this further.  Can you send me the gc_killMsgIfDestDown proc tcl file so I can review it?  Please send the file itself and not a screen shot or paste.

                Send to techsupport@healthvision.com attention David

              • #69937
                Robert Kersemakers
                Participant

                  David: done!

                  Be advised that our reseller has already created a call with Healthvision about this. I just wanted to know if I had missed a rule about thread names.

                  Cheers,

                   Robert

                  Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

                • #69938
                  Russ Ross
                  Participant

                    We have thread names that start with numbers and have scripts that call msi commands that aren’t giving us problems.

                    You might want to look at the oth_get_stat code I posted at this URL to see if that will help you not have to resort to a drastic measure like changing thread names.

                    <a href="https://usspvlclovertch2.infor.com/viewtopic.php?t=4063&#8243; class=”bbcode_url”>https://usspvlclovertch2.infor.com/viewtopic.php?t=4063

                    Russ Ross
                    RussRoss318@gmail.com

                  • #69939
                    Jim Kosloskey
                    Participant

                      Notice the proc to which Russ refers uses method one I described above.

                      That is it uses the INDEX of the thread NOT the NAME of the thread.

                      There is a flaw in the msigetstats that treats its first argument as an index if the first character is a digit. So if you have a thread NAME that starts with a digit, you will get a Tcl error unless you use method 1.

                      To be safe, I never use method 2 (thread NAME), I try to always use method 1 (INDEX of the thread name).

                      As far as I know there is no other requirement that a thread name not start with a digit.

                      Obviously the engine archtects use method 1 when doing engine stats since that is used without error on thread names starting with a digit.

                      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

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