Delay in stopping thread

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Delay in stopping thread

  • Creator
    Topic
  • #55599
    Paul Bishop
    Participant

    Cloverleaf version 6.1.1 on AIX.

    We are sometimes having an issue with a script (ksh) that we run to stop a thread that is writing to a file, doing something with that file including moving it, and then starting the thread back up for the next day’s processing.  What is happening is that the pstop command is issued, the file processing is done, the pstart command is issued, then the pstop command is finally processed by the engine.  This leaves the thread not running for the next day’s process and the file not generated.

    My question – besides putting in a sleep command after the pstop (5 seconds would do it), is there a way to have the script wait until the command has been processed?  

    I thought of writing a TCL script that does the stop and then doesn’t return control until the command has been processed (and throw a time limit in to keep infinite loops away), determined by looking at the thread status.

    Thanks,

    Paul Bishop
    Carle Foundation Hospital
    Urbana, IL

Viewing 1 reply thread
  • Author
    Replies
    • #85871
      Austin Adams
      Participant

      You could write a TCL script that loops through and check the initial file size, sleep about 3 seconds, and then check it again.  If the file size matches or if the file has already been moved then check to see if the file exists, then you would issue the pstop command. If it does not match, you would loop through again.

      I think a script would be the best way to handle it.  Although, I have used Alerts to do some kind of checking like check the last read message time or checking the up time of a thread and have it execute a command to stop or start a thread.

    • #85872
      Ed Mastascusa
      Participant

      you could try the “prestart” in place of the pstop then no need for the pstart – I think prestart is just a pstop on the front end anyway –  just make sure your time param is fairly  large, if you think 5 go with 10.

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

Forum Statistics

Registered Users
5,117
Forums
28
Topics
9,292
Replies
34,432
Topic Tags
286
Empty Topic Tags
10