From: Abhijit Sarkar Date: 2013-02-15T06:10:10+09:00 Subject: Re: Ruby Multithreaded producer-consumer problem Ryan Davis wrote in post #1096951: > That's great. That's the real problem the author wants you to solve. Sit > down with some paper and crayons / colored pencils and draw a picture of > the objects and what they have access to via your code. Then act out the > process. Can you understand how the deadlock occurs? What can you do to > avoid it? > If I were able to figure out the issue myself, why would I be sitting here having this conversation? Do you see the problem? If yes, would you be kind enough to point it out to me? If you do not see the problem yourself, well, what can I say. That's not to say that I am going to sit with my thumb in my mouth while someone else solves the problem for me. I am trying but a little help goes a long way. > You might want to Google dining philosophers for another example. I am very much aware of the Dining Philosophers example. It is not a producer-consumer problem. It suggests a possible way to avoid deadlocks which is to lock two shared resources in the same order in two competing threads. I do not see the relevance with my issue here as I am not dealing with two shared resources. -- Posted via http://www.ruby-forum.com/.