OpenMP Producer-Consumer unexpected result
问题 I am working on a simple producer-consumer problem, using OpenMP in C. My program creates 4 threads, two of which are consumers and two producers. Each producer places a character in a buffer, and the consumers just print the character. My aim is to synchronize the producers/consumers so that each producer will produce the next in order character of the alphabet and each consumer will print the next in order character that is placed in the buffer. This is my code: #include <stdio.h> #include