Im doing producer-consumer tasks using C++, but the consumer keeps consuming jobs while there is no job. why does this happen?

前端 未结 0 1041
慢半拍i
慢半拍i 2020-12-06 15:18
void *consumer (void *id) 

{     int id_ = conSerial;//this is a global variable for recording the number of consumer.eg:consumer(1),consumer(2)
conSerial++;
int sl         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题