Jump to content

question about running multiple scripts at the same time


Recommended Posts

I'm wondering if I'm likely to run into problems if I try to run multiple AutoIt programs at the same time. I want to create a multi-thread type program where each program is running and the communicating through writing and reading different files. I.e. program 1 will write a certain line to a file, program 2 will check that file every 30 seconds and use that information and then leave information in another file for program 3 etc.

Are there any general problems this might cause? The only thing I could think of is if multiple programs to access a file at the same time and read or write. I guess the chances of this happening at exactly the same time are pretty unlikely though.

Link to comment
Share on other sites

there is NO MULTITHREADING IN AUTOIT

...and will not be for a very long time.

Yes and if really read the top post you will see that the poster understands this. So he sugests a workaround and asks if that solution will sounds sound or will generate problems.

So, back to the problem.

Using Ini files or registry entries should work fine. If you want to make sure you don't get into trouble you could use a the CreateMutex and ReleaseMutex API in kernel32 when you update your variables in the file/registry to make sure there is no clashes. This is actually the same thing you should do when updateing shared memory in an application/language using multiple threads.

Link to comment
Share on other sites

  • Moderators

use a the CreateMutex and ReleaseMutex API in kernel32 when you update your variables in the file/registry to make sure there is no clashes.

I hadn't even realized that I do this myself. I use OpenSemaphore to tell me which ones are actually active so I'm interacting with them properly.

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

Several roads leading to Rome I guess..:)

If the registry or a ini file is used I would expect (but cant guarantee) that the OS does secure read/write operations.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...