Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why consumer thread is not starting?

 
raja singh kumar
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont know why my consumer/producer program is not working. I have a producer which uses a for loop to produce 10 values and a consumer to consume the value but after the first element is produced the program keeps running forever without any output. I dont know what is the problem. What exactly am I doing wrong? How do I fix the issue?








 
Henry Wong
author
Marshal
Pie
Posts: 22114
88
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
raja singh kumar wrote:What exactly am I doing wrong? How do I fix the issue?


It would be a good idea for your producer and consumer to share the same data holder. Otherwise, there is no communication.

Henry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic