question about running multiple scripts at the same time

6 posts in this topic

danpaul23 0

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.

Share this post

Link to post

Share on other sites

Uten 5

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.