用vc编写操作系统,你也可以做的到CCriticalSectioncsDocLock;//文件锁保证读写互斥CCriticalSectioncsReadCount;//读者记数互斥CCriticalSectioncsPreWriteLock;//写者优先锁intg_iReadCount=0;boolg_bPreWriter=false;//写者优先标志HANDLEhReadSemaphore=CreateSemaphore(NULL,3,3,"Semaphore1.object");//读者信号量共允许3个读者同时进行//线程体boolwho[3]={false};DWORDWINAPI