Help me generate script run with real multithread Topic is solved

Post AHK_H specific scripts & libraries and discuss the usage and development of HotKeyIt's fork/branch
gameba
Posts: 18
Joined: 20 Mar 2018, 12:24

Help me generate script run with real multithread

25 Mar 2018, 05:58

I created a script to help me find duplicate images in my image database(>1000000 images). pls, view code below:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



The script works fine.

I have a cpu intel core i7 4.8GHz 4core 8thread but I checked task manager, the script always use 14% cpu (86% idle). It does not work at full capacity because AHK not support multithread. So, I found AHK_H, I am a newbie, I don't have many experiments with AHK_H. I played with AHK_H 2 days but I don't know how to my script run with real multithreads.

Somebody can help me generate the script run with real multithread.
Thanks!
HotKeyIt
Posts: 1671
Joined: 29 Sep 2013, 18:35
Contact:

Re: Help me generate script run with real multithread  Topic is solved

25 Mar 2018, 08:29

Try something like this:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

gameba
Posts: 18
Joined: 20 Mar 2018, 12:24

Re: Help me generate script run with real multithread

25 Mar 2018, 08:53

@HotKeyIt, Thank you for your reply
I tried it and received a error
Image


I use window10 64bit, I installed AHK version: v1.1.28.00 - February 11, 2018 64bit and download AHK_H V2 alpha.

I copy all file (AutoHotkey.dll, AutoHotkey.exe, msvcr100.dll) in folder "x64w" and paste to "C:\Program Files\AutoHotkey" , I continues copy 2 folder "Compiler", "lib" and paste to "C:\Program Files\AutoHotkey". Is it the right way to install AHK_H V2 alpha?
HotKeyIt
Posts: 1671
Joined: 29 Sep 2013, 18:35
Contact:

Re: Help me generate script run with real multithread

25 Mar 2018, 09:57

Yes but the script above is for AutoHotkey_H v1, your picture is not displayed unfortunately, can you type down the error?
gameba
Posts: 18
Joined: 20 Mar 2018, 12:24

Re: Help me generate script run with real multithread

25 Mar 2018, 10:03

HotKeyIt wrote:Yes but the script above is for AutoHotkey_H v1, your picture is not displayed unfortunately, can you type down the error?

sorry, I forget set public image :D
HotKeyIt
Posts: 1671
Joined: 29 Sep 2013, 18:35
Contact:

Re: Help me generate script run with real multithread

25 Mar 2018, 10:09

This error is due to using AutoHotkey_H v2, try using AutoHotkey_H v1. AFAIK your Gdip functions are also not compatible with v2, otherwise you need to use proper syntax for v2:
ProcessSetPriority("High"), also remove Setbatchlines.
guest3456
Posts: 2361
Joined: 09 Oct 2013, 10:31

Re: Help me generate script run with real multithread

25 Mar 2018, 14:08

for reference, this GDIP library should work for v2:

https://github.com/mmikeww/AHKv2-Gdip

guest3456
Posts: 2361
Joined: 09 Oct 2013, 10:31

Re: Help me generate script run with real multithread

25 Mar 2018, 19:17

HotKeyIt wrote:What about Gdip_ImageSearch.ahk?


not included

gameba
Posts: 18
Joined: 20 Mar 2018, 12:24

Re: Help me generate script run with real multithread

25 Mar 2018, 20:11

HotKeyIt wrote:This error is due to using AutoHotkey_H v2, try using AutoHotkey_H v1. AFAIK your Gdip functions are also not compatible with v2, otherwise you need to use proper syntax for v2:
ProcessSetPriority("High"), also remove Setbatchlines.


You are god! you save my life. Now, I can maximise my CPU processor's efficiency . Thank you very much!

Image

Return to “AutoHotkey_H”

Who is online

Users browsing this forum: No registered users and 1 guest