Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 09:42

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Other metod of multithreading?

Discussion on Other metod of multithreading? within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
fuso98's Avatar
 
elite*gold: 428
Join Date: Dec 2011
Posts: 2,722
Received Thanks: 2,035
Other metod of multithreading?

There's some UDF or metod to make a script that support multithreading? I don't want make a loop or file comunication, i want an UDF that work very well it exits?
fuso98 is offline  
Old 01/03/2013, 22:57   #2
 
Croco™'s Avatar
 
elite*gold: 235
Join Date: Jan 2012
Posts: 920
Received Thanks: 377
Wiki:
Quote:
AutoIt is single threaded which makes asynchronous programming, concurrency and parallelism (e.g. communications applications) extremely difficult.
(This can be worked around through the use of such things as multiple processes, Component Object Model, etc., but it would be much less onerous if a multithreading API was provided for use within the language itself or its libraries.)
Croco™ is offline  
Old 01/04/2013, 01:29   #3
 
elite*gold: 0
Join Date: Aug 2011
Posts: 442
Received Thanks: 78
As said Autoit does not support multi threading your options are:

1. Run two seperate files (something im against file one does one thing then file 2 does something every x seconds)
2. Use adlibregister - Pauses your script and does the action you want every x seconds then continues where it left off.
logical691 is offline  
Old 01/04/2013, 09:56   #4
 
fuso98's Avatar
 
elite*gold: 428
Join Date: Dec 2011
Posts: 2,722
Received Thanks: 2,035
adlib register is not very good. There's a function that can execute a script in the same directory of the program without the manually execution?

sorry my bad english
fuso98 is offline  
Old 01/04/2013, 14:16   #5


 
Lawliet's Avatar
 
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685
Code:
Shellexecute(@autoitexe, "/Autoit3ExecuteScript " & @ScriptDir & "/somescriptname.au3")
Lawliet is offline  
Thanks
1 User
Old 01/04/2013, 18:26   #6
 
lolkop's Avatar
 
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
well threads get executed by the os like this:

Code:
execute part of thread1
execute part of thread2
...
execute part of threadN
execute part of thread1
...
thats what you can do in your script too...

Code:
While True
    <action1>
    <action2>
    [...]
    <actionN>
WEnd
for timed actions, use timer functions.

simply don't use script blocking stuff like sleeps, waits, "critical, time consuming innerloops"

to simplify this, the sum of time-consumption, of the "innerloop-actions, should stay below 0.5secs, so the user won't even notice, that there are multiple actions running in a row.
lolkop is offline  
Thanks
1 User
Old 03/30/2016, 23:36   #7
 
elite*gold: 0
Join Date: Mar 2016
Posts: 1
Received Thanks: 1
; This works very very well. Low CPU. All you have is the exe in memory for each thread.

; Send messages anyway you need. Try the iniwrite()/iniread(), regwrite()/regread, or fancy _NamedPipes.

#include <WinAPI.au3>
#include <MsgBoxConstants.au3>
#include <Array.au3>
#include <WinAPIShPath.au3>
#include <Misc.au3>

If $CmdLine[0] > 0 Then
If $CmdLine[1] = "MyFuncThread1" Then MyFuncThread1()
If $CmdLine[1] = "MyFuncThread2" Then MyFuncThread2()
If $CmdLine[1] = "MyFuncThread3" Then MyFuncThread3()
EndIf

If @Compiled Then
ShellExecute(@AutoItExe, "MyFuncThread1")
ShellExecute(@AutoItExe, "MyFuncThread2")
ShellExecute(@AutoItExe, "MyFuncThread3")
Else
ShellExecute(@ScriptName, "MyFuncThread1")
ShellExecute(@ScriptName, "MyFuncThread2")
ShellExecute(@ScriptName, "MyFuncThread3")
EndIf

;*** WARNING, if your thread returns without exiting - it will respawn. (Maybe you need that?)

Func MyFuncThread1()
_Singleton("MyFuncThread1", 0)
MsgBox(0, "", "Thread 1", 0)
Exit
EndFunc ;==>MyFuncThread1

Func MyFuncThread2()
_Singleton("MyFuncThread2", 0)
MsgBox(0, "", "Thread 2", 0)
Exit
EndFunc ;==>MyFuncThread2

Func MyFuncThread3()
_Singleton("MyFuncThread3", 0)
MsgBox(0, "", "Thread 3", 0)
Exit
EndFunc ;==>MyFuncThread3

Puppy609 is offline  
Thanks
1 User
Old 04/08/2016, 17:59   #8
 
FacePalmMan's Avatar
 
elite*gold: 0
Join Date: Jan 2013
Posts: 426
Received Thanks: 129
Real multithreading (like stated by Puppy 609) is too instable and is doomed to crash eventually if put in a script that runs constantly. It might be useful for dllcalls that take relatively high amounts of time to be executed, and whose return value you don't need.
FacePalmMan is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
NEW DUPE METOD !!!
07/08/2010 - Archlord Trading - 16 Replies
new dupe method on Archlord Wenzen 500Euros for info /pm me
<LEECHED>Wallhack iso metod
12/28/2009 - Soldier Front Hacks, Bots, Cheats & Exploits - 33 Replies
di ko pa po i2 na try kac nakalagay lang dun sa plunder undetedted pero di ko po alam pass kung kaya nyu i hack pass ni2 pakipost na lang po pass di ko po kac alam eh thanks new wallhack undetected.rar download - Plunder
What is the metod to log in psro?
03/10/2008 - SRO Private Server - 1 Replies
Easy2game work? pls man, post the method work?
Mail metod
01/22/2007 - CO2 Exploits, Hacks & Tools - 58 Replies
i think this is the best metod to scam a mail account and get the password of co user if you have a website with mail support you can use this 2 php files to send fake co mails :) you can modify the content of the mail inside the co.php file ... mine its make for a patch who use winvnc as a server. hope you will like it :)



All times are GMT +1. The time now is 09:45.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.