Threads or some form of parallelism
#1
Posted 03 July 2005 - 07:06 PM
#2
Posted 03 July 2005 - 08:06 PM
but thats probly not gonna hapen any time soon.
(maby in autoit v4/5 ?)
till then you can use AdLibEnable.
#3
Posted 03 July 2005 - 09:59 PM
What kind of interface do you have in mind?
#4
Posted 03 July 2005 - 10:21 PM
That is my technical standpoint. My opionated standpoint based on my experience with C++ is that multi-threading is rarely needed. I can just see some of the idiotic code that will be produced by the forum-morons trying to use multi-threading where it is not needed. I continue to go back to the Call() function when I want to point out that a lot of users really don't have enough sense to be using AutoIt. Its constantly misused as the primary method for invoking user functions. If people can't manage to figure out how to call a function, do they really need access to threading support?
I think that of these two points, the first should hold the most merit. Like adding object-oriented support, multi-threading is one of those things that needs decided on before writing the first line of code because supporting features like that require conscious development decisions that permeate throughout the entire application. You don't simply come along later and just add it in without either breaking everything already written or rewriting everything (Which will probably lead to breakage, too).
#5
Posted 04 July 2005 - 07:46 AM
#6
Posted 04 July 2005 - 08:13 AM
I guess AutoIt could do something similiar, just distribute several EXEs and run them using RUN (instead of RUNWAIT) and have some sort of system for them to communicate with the master script.
#7
Posted 04 July 2005 - 01:34 PM
You have command line parimeters and restart the script the in a different mode like this little script i made today.I used to do a thing with BAT files, where I would have a master BAT file that would START several other BAT files, each of which would log on to a server and get some data and log it to a file. The master BAT file would loop waiting for all the sub-BATs to log their data, and then concatenate it to a master log file. I guess you could call this a primative form of multi-threading (since I used START instead of START /WAIT).
I guess AutoIt could do something similiar, just distribute several EXEs and run them using RUN (instead of RUNWAIT) and have some sort of system for them to communicate with the master script.
This is good becuase you don't have to have multi exes which makes the distribution size smaller.
http://www.autoitscript.com/forum/index.php?showtopic=13190
Edited by SolidSnake, 04 July 2005 - 01:36 PM.
#8
Posted 04 July 2005 - 04:08 PM
#9
Posted 05 July 2005 - 04:55 AM
Then its just a matter of communication between scripts.
Yes this is possible now, by compiling and FileInstalling each "thread" then running them, but this method would simplify that process, keep the compiled executable small, and put all the source code in one file(for readability).--and wouldn't break existing scripts(providing it's possible to properly implement this)
probably the sanest tradeoff to get the end result without restructuring AutoIt's source Code.
Edited by quaizywabbit, 05 July 2005 - 11:12 PM.
#10
Posted 05 July 2005 - 07:21 AM
I like that idea. I haven't tried your program, but I think I know what you mean. If I have a need to do multiple tasks, I think I'll use that approach, unless something better comes up (as far as built-in features for AutoIt)You have command line parimeters and restart the script the in a different mode like this little script i made today.
This is good becuase you don't have to have multi exes which makes the distribution size smaller.
http://www.autoitscript.com/forum/index.php?showtopic=13190
#11
Posted 05 July 2005 - 03:07 PM
here is some ugly ascii to visualise my idee.
| | main flow | | \|/ Thread("ex") ----> function ex() | | | | some commands more commands | | | | \|/ \|/ END END
Edited by w0uter, 05 July 2005 - 03:08 PM.
#12
Posted 09 July 2005 - 10:25 AM
Together we might liveDivided we must fall
#13
Posted 09 July 2005 - 02:01 PM
If its so doable, when can I expect to see your implementation of it?w0uter..That would be a great idea..the best I've seen till now..hmm..and I've thought this multi-threading concept since Excalibur first brought it up..This is actually do-able..Will the Dev's actually do it?Great "work", man
..GREAT work..
#14
Posted 09 July 2005 - 05:34 PM
_DateAdd("d", -2, _NowCalcDate())
#15
Posted 19 July 2005 - 08:18 AM
Together we might liveDivided we must fall
#16
Posted 19 July 2005 - 01:19 PM
Did you actually read my comments and the comments of David (Nutster)? Both of us are quite familiar with the internal implementation of AutoIt. Both of us separately came to the conclusion that AutoIt would virtually need re-written to properly implement multi-threading. It is not "do-able" without writing a hack-job attempt or modifying every critical piece of AutoIt's implementation that has proven stable enough and doesn't need touched. It irks me just a bit that David and I both stated this and then people come along and ignore what we say and continue on their merry way saying "do it do it" when they have no real clue what it takes to do it and those who do have a clue have said why they won't do it.Hmm..my implementation?Simply FileInstall("Aut2exe.exe") then make a temp exe from the func..run it without a tray icon..but that's lame and slow..BTW..when can I see anything better than useless comments..like YOUR hardcoded implementation..
#17
Posted 19 July 2005 - 03:01 PM
A lot of us would love to see a fully threaded AutoIt, but it's not gonna happen. Even professional programmers can have a hard time writing/debugging multi-threaded code. I can't imagine turning such functionality over to the average user of AutoIt, especially without a debugger.
Hypothetically, yes it could be done. You *might* even be able to put in a very high level mutex in the interpreter and take a huge performance hit, but odds are even then, you would just be better off writing multiple scripts and executing them simultaneously.
Finally, I would suggest you check out AdLibEnable() I've found that most things I wanted to handle in a multi-threaded fashion, I can tinker something together using this function.
#18
Posted 19 July 2005 - 03:24 PM
Together we might liveDivided we must fall
#19
Posted 19 July 2005 - 03:51 PM
#20
Posted 19 July 2005 - 03:58 PM
- Stops all current development except for this feature because this feature will impact everything.
- Throws away 2+ years of tested and stable code in favor of exponentially more complex and untested code.
- Redefines how the language works on every level.
The best way to implement this is to start with 0 lines of code and go for there. The current architecture does not lend itself to multi-threading. It would be easier to start with a blank file and go from there than it would start from the existing code base. Trying to fit multi-threading into the current architecture or modify the architecture to support multi-threading leads to several significant and insurmountable flaws. This includes limiting the API so that it can work with as much current code as possible. This will cause the threading supporting not to live up to its potential. It will also force modifications to the existing code, anyway, breaking their stability. A proper design from scratch and then re-writing everything, maybe using the existing code as reference-only, is the only way to implement this.
Also, 95% of the time, multi-threading is not necessary. In general, multi-threading is a sign of poor or lazy design as opposed to clever programming. Multi-threading is never necessary; however, it can be convenient at times with regards to code organization. All multi-threaded applications have a single-threaded equivalent. That single-threaded equivalent will be terribly complex and hard to maintain, but it can be done.
So in summation, AutoIt 3 will probably not see multi-threading in its lifetime (or current iteration) because:
- Most programs do not need multi-threading, they just need better designs.
- Multi-threading can not be implemented properly in the current version of AutoIt without throwing away years worth of work.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users



This topic is locked
