Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #cs
- Registering these threads will halt the event / loop that's already running resulting in partial-multithreading functionality
- Note that this slows down your program to an extent, but not substancially.
- #ce
- Simulation() ; start the simulation
- Func Simulation()
- $dummy_boolean = False
- ThreadRegister()
- Do ; Make a deliberate infinite-loop
- MsgBox(0, "", "test")
- Until $dummy_boolean = True
- EndFunc
- Func ThreadRegister() ; Register the threads
- AdlibRegister("Thread1", 100)
- AdlibRegister("Thread2", 100)
- AdlibRegister("Thread3", 100)
- EndFunc
- Func Thread1()
- $nMsg = GUIGetMsg()
- If $nMsg = $EVENT Then
- ; Do stuff
- EndIf
- EndFunc
- Func Thread2()
- $nMsg = GUIGetMsg()
- If $nMsg = $EVENT Then
- ; Do stuff
- EndIf
- EndFunc
- Func Thread3()
- $nMsg = GUIGetMsg()
- If $nMsg = $EVENT Then
- ; Do stuff
- EndIf
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement