From: Ryan Davis Date: 2013-02-15T08:43:01+09:00 Subject: Re: Ruby Multithreaded producer-consumer problem On Feb 14, 2013, at 13:10 , Abhijit Sarkar wrote: > 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. If I knew you were going to act like that I wouldn't have bothered writing in the first place. Sit down _away_ from your code. Draw out the problem on _paper_. Act it out. I actually like to act it out with one person per object, but sometimes that is not feasible. If you can't figure it out from there, you're probably not drawing the problem out correctly or completely.