Dining philosophers problem - only 2 thread worked
问题 I am trying to solve the dining philosophers problem. In my case, every philosopher should eat 1,000,000 times. The problem is that it seems like only "1" and is "3" finished eating. I am using threads with critical section lock, here is my code: CRITICAL_SECTION ghCARITICALSection1; CRITICAL_SECTION ghCARITICALSection2; CRITICAL_SECTION ghCARITICALSection3; CRITICAL_SECTION ghCARITICALSection4; CRITICAL_SECTION ghCARITICALSection5; DWORD WINAPI func(int* phiphilosopher) { if (1 ==