★★★★这样的模型会不会死锁,或者有没有更好的方法(模型)????★★★★
surfl 2004-11-25 05:05:18
HANDL hForRead;
HANDl hForWrite;
读进程
while(1)
{
SetEvent(hForWrite);
WaitForSingleObject(hForRead,INFINTE);
ResetEvent(hForWrite);
...写数据
}
写进程
while(1)
{
SetEvent(hForRead);
WaitForSingleObject(hForWrite,INFINTE);
ResetEvent(hForRead);
...读数据
}