haitao:
好像不复杂吧?池中的进程空闲时死循环这么作:
[阅读: 606] 2004-12-29 14:02:25
L_free:
while (1)
{
switch (共享全局数组[本进程序号])
{ case 0:
sleep(100); continue;
case 1:
goto L_in1;
case 2:
goto L_in2;
...
}
}
L_in1:
...
共享全局数组[本进程序号]=0;
goto L_free;
L_in2:
...
共享全局数组[本进程序号]=0;
goto L_free;
...