langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
|
|
@ -0,0 +1,24 @@
|
|||
#Threads=10
|
||||
#Parallels=3
|
||||
Global Semaphore=CreateSemaphore(#Parallels)
|
||||
|
||||
Procedure Worker(*arg.i)
|
||||
WaitSemaphore(Semaphore)
|
||||
Debug "Thread #"+Str(*arg)+" active."
|
||||
Delay(Random(2000))
|
||||
SignalSemaphore(Semaphore)
|
||||
EndProcedure
|
||||
|
||||
; Start a multi-thread based work
|
||||
Dim thread(#Threads)
|
||||
For i=0 To #Threads
|
||||
thread(i)=CreateThread(@Worker(),i)
|
||||
Next
|
||||
Debug "Launcher done."
|
||||
|
||||
; Wait for all threads to finish before closing down
|
||||
For i=0 To #Threads
|
||||
If IsThread(i)
|
||||
WaitThread(i)
|
||||
EndIf
|
||||
Next
|
||||
Loading…
Add table
Add a link
Reference in a new issue