int index;
While (1)
{
Index=WaitForMultipleObjects (10, phNormal, false, INFINITE).
NIndex=nIndex - WAIT_OBJECT_0;
The CloseHandle (phNormal [nIndex]);
}
Such as parameter Settings, suppose I wait ten end of the process, the 10 process has been created, respectively is a process phNormal [0] ~ phNormal [9],
Situations like this:
Cycle for the first time, if over, at the same time there are three process is 1, 2, and 3, respectively, then WaitForMultipleObjects () returns a value, refers to the phNormal [1] quits, i.e. waiting for the object, the object sets minimum this I understand.
Then enter the second loop, assuming no other process exits, then the last cycle has withdrawn from process of no. 2 and 3 can be WaitForMultipleObjects wait ()? The phNormal [2] has withdrawn from information, also can be WaitForMultipleObjects () to catch??
(e.g., what didn't fully clear, still hope to point out mistakes,)
CodePudding user response:
Otherwise, what is the point of this API? You can easily verify...CodePudding user response:
Read "Windows core programming"CodePudding user response: