Quote:
Originally Posted by sliwja
Mr Guitou (or someone else) can u look on it think it should work
start multithread:
line 1598 AdlibRegister ("readcolor") >> go to readcolor (one thread)
line 1599 AdlibRegister ("infostats") >> go to line 2474 (second thread)
"infostats" is line 2474 to line 2642
line 1626 to 1643 >> geting info from "infostats"
and ending threads
line 1675 AdlibUnRegister("readcolor")
line 1686 AdlibUnRegister("infostats")
sory for pl gui
|
So first, take in mind that my knowledge is really really short. before make my little analyze, I want you to understand few things:
-> I don't really know how developing with auto-it (except GUI and file-use, it's the only things I think I can do without need to look at help every line ^^)
-> I study C/C++ when I was younger, but it made 7 years that I don't practice it at all so now I just have some theoric knowledge remind.
-> As I'm french and only study english at school and never have any need to speak technical english with other people, I should make some sentences that just have any sense. So don't hesitate to ask if you don't understand something I said. Multithread is enough hard to use for take time to really understand everything needed. I know I have poor english ^^ So help me to improve it ^^
-> I'm not a teacher, and i'm not a proffessional developer. I have my own way to wrote code, my own way to see things. It should be really strange if we have exactly the same, and mine should not be better than yours, so if you disagree with me, don't hesitate to explain your way ^^
If you understand all that, then we should start learning something together ^^
First of all, little analisis you required:
-> What I saw in AutoIt help about function you use, is exactly what I ask you to take care of, so you made what I said without know it :D
In fact, when functions you declare in
AdlibRegister is used, other thread,
all the other (GUI, farm func, other AdlibRegister function, etc...) are just paused while the function haven't reach its end.
-> It still multithread, even if said as I did further it don't really look like. It is multithread because
AdlibRegister function call define function every XXX ms (it's the second parameter of
AdlibRegister ;) )
-> AdlibRegister may be usefull for fast value treatment. Not for calling 4/5/6 other functions. So according to this, what you did should not work as you wish.
And then, few advices, don't think it's the best way, it's just the way I should have made it if I here you:
-> You should write and call full new function for
readcolor, dedicated for detect pixel and store values in a dedicated thread, and never use this function anywhere else. In the same way, take care at using a real global array variable, not only something allocated in GUI loop, for store data. It should be more clear to debug, and really more easy to use...
-> Same thing for
Inforstat. Write a full new one, dedicated to make operating stuff on stats values, and nothing else. And never use this ful new function somewhere else. Only after
AdlibRegister it ;)