• Post Reply Bookmark Topic Watch Topic
  • New Topic

Producer Consumer Problem  RSS feed

 
Soujanya Duvvi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In this program first the consumer part is being executed and no elements is being displayed as result. Can anyone please let me know where the problem is in this program.




Thanks and Regards
Soujanya
 
Paul Clapham
Sheriff
Posts: 22512
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shouldn't the producer and the consumer be working on the same put_get object?
 
Paul Clapham
Sheriff
Posts: 22512
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch, by the way. I also feel that your consumer ought to wait to see if the producer puts anything into the queue. Right now it just says "Nothing in the queue? Okay! I'm done!"
 
Soujanya Duvvi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:And welcome to the Ranch, by the way. I also feel that your consumer ought to wait to see if the producer puts anything into the queue. Right now it just says "Nothing in the queue? Okay! I'm done!"


Thanq Paul Clapham for the reply. As they are not working on the same object first the consumer thread is being invoked or no elements is being printed as the output.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!