AutoHotkey.dll (AhkDllThread) Topic is solved

Ask for help, how to use AHK_H, etc.
lsh

AutoHotkey.dll (AhkDllThread)

14 Sep 2017, 06:55

Code: Select all

loop,10000
{
AhkDllRank% A_index%: = AhkDllThread(%ScriptDir%\autohotkey_H_unicode_32.dll)
ScriptPath: = A_ScriptDir. "\ ". A_index. ". ahk "
SFile: = FileOpen (ScriptPath, "r ")
SText: = SFile.Read ()
SFile.Close ()
AhkDllRank% A_index% .AhkTextDll(SText)
}
If you run this script repeatedly, you will get 262 indexes (1 SFile -> 100KB)

[Error Continuable exception_access_violation
Mouse and Keyboard hooks have benn disabled.
-Press Yes to exit thread and continue execution
-Press no to continue thread (debug).
-Press cancel to exit application
exception was caused in thread id : 8004]

Error.

My guess is that there is a maximum limit for multithreading in A's,

Is there a way to perform 1000 indexes ... and even 10000 indexes without difficulty :?:
edit: duplicate post removed
HotKeyIt
Posts: 1876
Joined: 29 Sep 2013, 18:35
Contact:

Re: AutoHotkey.dll (AhkDllThread)

14 Sep 2017, 15:19

There is a limit for the Stack StackReserveSize * Threads, see: https://github.com/HotKeyIt/ahkdll/blob ... xproj#L168
ExeThread in AHK_H v2 can handle a lot more threads, following stops for me at ~3500 threads:

Code: Select all

loop 10000
	e%A_Index%:=ExeThread("#Persistent"),ToolTip(A_Index)
User avatar
manehscripts
Posts: 102
Joined: 03 May 2019, 16:10

Re: AutoHotkey.dll (AhkDllThread)

07 Aug 2019, 09:07

HotKeyIt wrote:
14 Sep 2017, 15:19
There is a limit for the Stack StackReserveSize * Threads, see: https://github.com/HotKeyIt/ahkdll/blob/master/AutoHotkey.vcxproj#L168
ExeThread in AHK_H v2 can handle a lot more threads, following stops for me at ~3500 threads:

Code: Select all

loop 10000
	e%A_Index%:=ExeThread("#Persistent"),ToolTip(A_Index)
Hi!

I'm having the same problem.
There is no way to prevent this error other than by migrating to AHK_H v2 ?
-----------------------------------------------------------
Stop to think, shut up to resist, and act to win!
swagfag
Posts: 2981
Joined: 11 Jan 2017, 17:59

Re: AutoHotkey.dll (AhkDllThread)  Topic is solved

07 Aug 2019, 11:03

manehscripts wrote:
07 Aug 2019, 09:07
There is no way to prevent this error other than by migrating to AHK_H v2 ?
there is. dont spawn 10000 threads

Return to “Ask For Help”

Who is online

Users browsing this forum: No registered users and 11 guests