Code: Select all
Procedure idle(*void)
Repeat
Delay(1)
ForEver
EndProcedure
For x = 1 To 100
CreateThread(@idle(),0)
Next
Repeat
Delay(1)
ForEver
Code: Select all
Procedure idle(*void)
Repeat
Delay(1)
ForEver
EndProcedure
For x = 1 To 100
CreateThread(@idle(),0)
Next
Repeat
Delay(1)
ForEver
Depending on the testmachine it's between 4%-10% with 3msecs which is still too high.netmaestro wrote:What does it do to your cpu load if you increase from 1 ms to say, 3?
Perfect wait sounds good. I've a few ideas how a semaphore could help wait but that would deny nonblocking loops (e.g. usage of "Trysemaphore" or nonblocking sockets) isn't it?Fred wrote:you should use a semaphore to have a perfect wait