Azevedo

Does AU3 support simultaneos threads?

20 posts in this topic

#1 ·  Posted (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 by Azevedo

Share this post


Link to post
Share on other sites



No. And Multi-threading is not on the ToDo-list.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

ouch.

thanks

Share this post


Link to post
Share on other sites

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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 / ...)

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by Radiance

Share this post


Link to post
Share on other sites

Azevedo,

Search for "inter process communication" - my personal favourite is trancexx's MailSlot. :)

M23

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Azevedo,

Search for "inter process communication" - my personal favourite is trancexx's MailSlot. :)

M23

 

Thanks, but I would never use such a dirty trick :)

Share this post


Link to post
Share on other sites

Azevedo,

 

I would never use such a dirty trick

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". :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Radiance & Azevedo,

Please read this announcement before posting again. :naughty:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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". :huh:

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

2 people like this

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

I child process is considerable... it got me thinking. But a child of a child... nops.

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

#20 ·  Posted (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 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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now