Uling Posted March 9, 2006 Share Posted March 9, 2006 hi ! Is it able and usefull to run a function as a new (hidden) process that could be watched by the main script ? Then the main script can kill it if it hangs. Link to comment Share on other sites More sharing options...
Valuater Posted March 9, 2006 Share Posted March 9, 2006 yes 8) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 9, 2006 Moderators Share Posted March 9, 2006 hi !Is it able and usefull to run a function as a new (hidden) process that could be watched by the main script ?Then the main script can kill it if it hangs.What do you mean by hidden process? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Uling Posted March 9, 2006 Author Share Posted March 9, 2006 I have a GUI with Buttons that call functions. *wow* If one of these functions hang up, the whole scrict hangs. I want the main script watch these functions if they are working or hanging. like timeout or so. but how to check a hanging script it self ? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 9, 2006 Moderators Share Posted March 9, 2006 I have a GUI with Buttons that call functions. *wow* If one of these functions hang up, the whole scrict hangs.I want the main script watch these functions if they are working or hanging.like timeout or so.but how to check a hanging script it self ? You create the script with error debugging within the funtions... "If said statement true Then Do something" "Else Return Error Number"... take a look at the macor @error, and the function SetError() in the help file.As far as MultiThreading, the closest thing we have is AdlibEnable() unless you want to learn to use StderrRead /StdOutRead/StdWrite in the help file. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Valuater Posted March 9, 2006 Share Posted March 9, 2006 I hate guessing... show us SOME SCRIPT 8) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 9, 2006 Moderators Share Posted March 9, 2006 I hate guessing... SHOW US SOME SCRIPT8)Ha!!, I read that.. and my mind is totally in the gutter... I imagined myself at the Nudy Bar... Getting impatient... and saying.... FOR THE LOVE OF GOD... SHOW US SOME SCRIPT!!! That's going to be my new saying in life.... It will totally throw people off! Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Valuater Posted March 9, 2006 Share Posted March 9, 2006 (edited) Ha!!, I read that.. and my mind is totally in the gutter... I imagined myself at the Nudy Bar... Getting impatient... and saying.... FOR THE LOVE OF GOD... SHOW US SOME SCRIPT!!! That's going to be my new saying in life.... It will totally throw people off! lol... RonEDITyour not going to believe this ... nudy bar ana all... this was my "69" post for the day8)EDITthe counter went to 68... this is a test Edited March 9, 2006 by Valuater Link to comment Share on other sites More sharing options...
Uling Posted March 10, 2006 Author Share Posted March 10, 2006 AdlibEnable() seems to be what I'm looking for. thank you ! ---- flip da script ! Link to comment Share on other sites More sharing options...
neogia Posted March 23, 2006 Share Posted March 23, 2006 I've now created a UDF library which supports multithreading, so in this way, you could "watch" a script from the main script. Example: You know a script shouldn't take more than, say, 10 seconds to complete. If it does, then it is a hung script.#include "Coroutine.au3" $thread = _CoCreate('Func ChildScript()|MsgBox(0,"","Hope this doesn''t hang!")|While 1|Sleep(100)|WEnd|EndFunc', "|") $timer = TimerInit() $instance1 = _CoStart($thread) While _CoStatus($instance1) <> "dead" If TimerDiff($timer) >= 10000 Then MsgBox(0,"Error","Child script has hung.") ExitLoop EndIf Sleep(100) WEnd _CoCleanup()Coroutine.zip [u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now