Azevedo Posted February 26, 2015 Share Posted February 26, 2015 (edited) (topic title: simultaneos --> simultaneous) Hello. I'm writing a script to work like a very simple download manager. Is it possible to have a multi-thread in AU3? Say it have a listbox with 3 downloads URLs and I want to download them in separed threads simultaneously. (not one after another) Can AU3 handle this? Edited February 26, 2015 by Azevedo Link to comment Share on other sites More sharing options...
Solution water Posted February 26, 2015 Solution Share Posted February 26, 2015 No. And Multi-threading is not on the ToDo-list. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Azevedo Posted February 26, 2015 Author Share Posted February 26, 2015 ouch. thanks Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 26, 2015 Moderators Share Posted February 26, 2015 Azevedo, Is it possible to have a multi-thread in AU3?As explained in multiple threads (pun intended) on the forum you cannot run several threads from one script. But you can run a child script multiple times from a parent, which in your case would seem to be enough. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Azevedo Posted February 26, 2015 Author Share Posted February 26, 2015 Azevedo, As explained in multiple threads (pun intended) on the forum you cannot run several threads from one script. But you can run a child script multiple times from a parent, which in your case would seem to be enough. M23 ok. But how would I have a callback from the child scripts? (error 404 / http 200 OK / download finished / ...) Link to comment Share on other sites More sharing options...
Radiance Posted February 26, 2015 Share Posted February 26, 2015 (edited) You could use exit codes in your child scripts to get the outcome. This requires that your main script waits for completion, like RunWait. If that's not what you want you could look into inter process communication. Edited February 26, 2015 by Radiance Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 26, 2015 Moderators Share Posted February 26, 2015 Azevedo,Search for "inter process communication" - my personal favourite is trancexx's MailSlot. M23 Mobius 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Azevedo Posted February 26, 2015 Author Share Posted February 26, 2015 You could use exit codes in your child scripts to get the outcome. This requires that your main script waits for completion, like RunWait. If that's not what you want you could look into inter process communication. That comes to the problem here. RunWait will be single thread. Link to comment Share on other sites More sharing options...
Azevedo Posted February 26, 2015 Author Share Posted February 26, 2015 Azevedo, Search for "inter process communication" - my personal favourite is trancexx's MailSlot. M23 Thanks, but I would never use such a dirty trick Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 26, 2015 Moderators Share Posted February 26, 2015 Azevedo, I would never use such a dirty trickWould you care to expand on that comment? I have found that UDF very useful on occasion and by no means would I describe it as a "trick". M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Radiance Posted February 26, 2015 Share Posted February 26, 2015 Thanks, but I would never use such a dirty trick Lol. If you'd come up with a better type IPC I would kiss your feet man. One of the worst topics imo. Link to comment Share on other sites More sharing options...
Azevedo Posted February 26, 2015 Author Share Posted February 26, 2015 Lol. If you'd come up with a better type IPC I would kiss your feet man. One of the worst topics imo. Dude, keep your unnecessary comments to yourself. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 26, 2015 Moderators Share Posted February 26, 2015 Radiance & Azevedo,Please read this announcement before posting again. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Radiance Posted February 26, 2015 Share Posted February 26, 2015 Dude, keep your unnecessary comments to yourself. Apologies, didn't mean to upset you. It's just that IPC is not one of my favorite topics, I've tried so many variants and the one Melba23 statet is one of the best and cleanest. Link to comment Share on other sites More sharing options...
Azevedo Posted February 26, 2015 Author Share Posted February 26, 2015 Azevedo, Would you care to expand on that comment? I have found that UDF very useful on occasion and by no means would I describe it as a "trick". M23 Sure! It is wasteful (memory + cpu time) to open preccess trees to perform trivial tasks. Then it would be not a child proccess, a grandchild proccess. No way I'd pipe that way. Link to comment Share on other sites More sharing options...
Azevedo Posted February 26, 2015 Author Share Posted February 26, 2015 Apologies, didn't mean to upset you. It's just that IPC is not one of my favorite topics, I've tried so many variants and the one Melba23 statet is one of the best and cleanest. I agree it is the best solution in AU3 programming. But I'd never do that. REAL multi threading is 100x faster and reliable than piping it through a 3 generation proccess tree. Link to comment Share on other sites More sharing options...
iamtheky Posted February 26, 2015 Share Posted February 26, 2015 Are you enlightening us on the benefits of multithreading, or just disparaging the solutions that allow for IPC. It is wasteful (memory + cpu time) to open preccess trees to perform trivial tasks. This is a retarded statement, about a language that is transparently if not deliberately slow and wasteful. If your mission is speed and efficiency you made the first wrong turn when you selected this language, and then the second was coming here to tell us about the obvious. jaberwacky and Radiance 2 ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Azevedo Posted February 26, 2015 Author Share Posted February 26, 2015 I child process is considerable... it got me thinking. But a child of a child... nops. Link to comment Share on other sites More sharing options...
Azevedo Posted February 26, 2015 Author Share Posted February 26, 2015 Are you enlightening us on the benefits of multithreading, or just disparaging the solutions that allow for IPC. This is a retarded statement, about a language that is transparently if not deliberately slow and wasteful. If your mission is speed and efficiency you made the first wrong turn when you selected this language, and then the second was coming here to tell us about the obvious. so unnecessary comment... Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 27, 2015 Moderators Share Posted February 27, 2015 (edited) I think I'm lost on a child of a child... But more than that, there are many IPC methods, mailslot was only one of them. TCP/UDP - Main script is the server, the child spawns do a quick client like SQLite/File/Ini/Etc Method, not really recommended, all that fileopen/write/close/read, bound to overlap somewhere GUIRegisterMsg + WM_COPY where you have two parts communicate via GUI I'm sure there are others I'm missing off the top of my head, I think the point they were making was this... Answering your question directly, No, there is no multi-threading in AutoIt, however an "alternative" may be IPC, and their opinion is that mailslot is the cleanest solution for their needs that they've encountered. It didn't require a comment/reply, especially a derogatory one that has literally no merit here. My suggestion... Create your application in a language in that supports multi-threading since you feel you understand it, and use the AutoItX dll to do the medial things you feel the language is for in the first place (I took the liberty of assuming here )... win ... win. Edited February 27, 2015 by SmOke_N 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...
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