Jump to content

Recommended Posts

Posted (edited)

Tested Op code on 500 thread time taken ==> 28ms

to test.... if it worked for you :)
just change the $no_Thread

Local $no_Thread = 500    

 

and edit the loop to

Local $hTimer = TimerInit()
While 1
    If $thread_Count = UBound($h_CreateThread) Then
        ExitLoop
    Endif
WEnd
Local $fDiff = TimerDiff($hTimer)
MsgBox(0, "Time Difference", $fDiff)    ;~ 28

and don't forget to comment out the _ArrayDisplay or you have to click 500 times :lmao:

 

point to be noted: Msgbox within inner loop not imp so I remove it :)

side note: 
forum member sought for Multithreading but no comment about if it worked or not :sweating: after posted 

Edited by jugador
Posted

Runnign your code just works fine for me.
Setting the # of threads to 500 returns: 669 ms on a Windows 7 VirtualBox machine running AutoIt 3.3.16.1.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted
  On 2/10/2024 at 10:16 AM, jugador said:

there may be other point that can make your code crash

Expand  

tested the original post and got me a "!>15:16:23 AutoIt3 ended. rc:-1073741819"
2nd post !>15:19:11 AutoIt3 ended. rc:-1073740940
removed "_ArrayDisplay", same.

Tested as x32 and x64, OS:WIN_10/2009

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted

@water I dont know why that much time difference 
but you can see the performance difference (Multithreading vs no Multithreading)

Local $hTimer = TimerInit()
    Local $Array[100][10]
    Local $no_loop = 500
    For $m = 1 To $no_loop
        For $i = 1 To UBound($Array) - 1
            For $k = 1 To UBound($Array, 2) - 1
                $Array[$i][$k] = "Hello - world"
                $Array[$i][$k] = StringToBinary($Array[$i][$k])
            Next
        Next
    Next
Local $fDiff = TimerDiff($hTimer)
MsgBox(0, "Time Difference", $fDiff)

 

@argumentum  I hope you have not make any changes in the op code.

I tested on win 7 and I get error rc:-1073741819 when I use sleep or Array size to big.
otherwise it run smooth for me.

so for debug purpose on win10 change

Local $no_Thread = 1

and in child thread change this

Local $Array[100][10]
For $i = 1 To UBound($Array) - 1
    For $k = 1 To UBound($Array, 2) - 1
        $Array[$i][$k] = "Hello - world"
        $Array[$i][$k] = StringToBinary($Array[$i][$k])
    Next
Next


to this :sweating:   and then increase the array size gradually to see at which point you are getting @error

Local $Array[1[1]    ;<<=====
For $i = 1 To UBound($Array) - 1
    For $k = 1 To UBound($Array, 2) - 1
;        $Array[$i][$k] = "Hello - world"
;        $Array[$i][$k] = StringToBinary($Array[$i][$k])
    Next
Next

if that still not solved the problem then google why getting error using CriticalSection on win10?
and Do post your debug result :D

Posted
  On 2/11/2024 at 6:33 AM, jugador said:

I hope you have not make any changes in the op code

Expand  

Why do you think that I know machine code or assembly or anything other than copy'n'paste !

And all these chunks, .. nope. The way to go about it is to post running code.

  On 2/11/2024 at 6:33 AM, jugador said:

if that still not solved the problem then google why...

Expand  

:imwithstupid:

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

  • 3 weeks later...
Posted

I have noticed that when I run these multithreading -- I'll call them emulations in an attempt to not rile feathers and which seem to work well for everyone else they however always result in a "AutoIt3.exe ended.rc:-1073741819" for me. I hope that sentence wasn't too oddly structured for non native speakers. I feel that it might be.

  • jugador changed the title to CriticalSection
Posted

To avoid confusion what this thread about change title and edit op post.

Autoit not support Multithreading so this type of error normal 
you can try _WinAPI_WaitForSingleObject 

multithreading only possible if Autoit developer support this via external dll.

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
  • Recently Browsing   0 members

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