Announcement

Collapse
No announcement yet.

Scheduling algorithm for user scripts

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Scheduling algorithm for user scripts

    Apparently only the most recently initiated script is eligible to execute. If script Try1 is executing, and calls hs.WaitSecs or hs.WaitEvents, and script Try2 gets started during that time, then Try1 will not get a chance to execute again until Try2 ends (despite the fact that Try2 calls the Wait methods. Is this a characteristic of script processing in general? It seems wrong.
    This behavior is with HomeSeer 1.5.0.2 build 27 (and earlier) on WindowsXP.
    Here is the script for Try1 (2 and 3 similar):

    sub main()
    dim mytime
    dim tries
    hs.WriteLog "Begin try1", 0
    for tries = 1 to 4
    hs.WriteLog "Here is try1", tries
    hs.WaitSecs 4
    hs.WaitEvents
    next
    hs.WriteLog "End of try1", 99
    end sub

    And here is the log, when the three scripts are executed from separate manual HS events:

    2/10/2002 9:09:02 PM~!~Event Trigger~!~Trigger from menu (Try1)
    2/10/2002 9:09:02 PM~!~Begin try1~!~0
    2/10/2002 9:09:02 PM~!~Here is try1~!~1
    2/10/2002 9:09:07 PM~!~Event Trigger~!~Trigger from menu (Try2)
    2/10/2002 9:09:07 PM~!~Begin try2~!~0
    2/10/2002 9:09:07 PM~!~Here is try2~!~1
    2/10/2002 9:09:13 PM~!~Event Trigger~!~Trigger from menu (Try3)
    2/10/2002 9:09:13 PM~!~Begin try3~!~0
    2/10/2002 9:09:13 PM~!~Here is try3~!~1
    2/10/2002 9:09:17 PM~!~Here is try3~!~2
    2/10/2002 9:09:21 PM~!~Here is try3~!~3
    2/10/2002 9:09:25 PM~!~Here is try3~!~4
    2/10/2002 9:09:29 PM~!~End of try3~!~99
    2/10/2002 9:09:29 PM~!~Here is try2~!~2
    2/10/2002 9:09:33 PM~!~Here is try2~!~3
    2/10/2002 9:09:37 PM~!~Here is try2~!~4
    2/10/2002 9:09:41 PM~!~End of try2~!~99
    2/10/2002 9:09:41 PM~!~Here is try1~!~2
    2/10/2002 9:09:45 PM~!~Here is try1~!~3
    2/10/2002 9:09:49 PM~!~Here is try1~!~4
    2/10/2002 9:09:53 PM~!~End of try1~!~99

    #2
    This has been discussed recently in another problem report thread. Rich responded with an example of how to run scripts in independent processes so this dependency does not exist. Running scripts independently is easy with WSH per his example, however when it comes to ASP applications we are kind of stuck. He did mention that he will consider multithreading in the future.

    Comment

    Working...
    X