2 scripts call same .dll concurrent, desyncronize

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Jovannb
Posts: 268
Joined: 17 Jun 2014, 02:44
Location: Austria

2 scripts call same .dll concurrent, desyncronize

24 Apr 2021, 06:14

Hi

I've 2 independen AHK-Scripts (A & B) which use the same AHK-Library, Class_MySQLAPI.ahk and therewith I query my databases.

Both script A and script B are time driven and run periodically (eg. A every 60 sec and B every 180 sec).

Now I found, that if, A sends a query to my database and B wants to query the same or other databases at same time, I'm getting "libmysql.dll" not found - that .dll is called/required by Class_MySQLAPI.ahk.

To solve that, I wanted A to check, before it starts a query, wether B isnt quering the databases just in that second and vice versa.

I kow, I could use a lock file (A -> writes lockfile, A-> query database, A->deletes lockfile and B checks wether that lockfile exists before it starts its query and vice versa), but probably there is a more elegant, a better way for locking those scripts against each other not to use the same Module (which then means the same .dll) at the same time ?

Regards

J.B.
AHK: 1.1.37.01 Ansi, 32-Bit; Win10 22H2 64 bit, german

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: peter_ahk and 369 guests