So now, if multiple signal Ill objects get the index of the first. Do I need to quote though my array to see if others have signaled?
Why not just go back to Wait ()? if several objects are signaled, they will still be signaled when you return. Of course, if you have a very fast bombardment of the first object in the array of the waiting object, it will starve on others; what you do is to arrange your objects in the array of the waiting object by the frequency of fire, with the least frequent being the first.
By the way, where you use infinite for (), you can use goto. Unless you really get out of the loop, the unconditional goto most correctly expresses your intentions.
user82238
source share