From: rubix Rubix Date: 2011-10-16T05:52:55+09:00 Subject: Re: deadlock producer consumer thanks Sean, I have a version with PriorityQueue from algorithms gem to pop the item with the highest priority first but I had the problem of deadlock but I tried today before your post a version with two standard queue but it doesn't work too, I don't know why you add the lines : --------------- item[:consumer] += 1 ---------------- and ---------------------- # start things off producer_queue.push({ :producer => 0, :consumer => 0}) # either will work #consumer_queue.push({ :producer => 0, :consumer => 0}) ------------------------------ I'll try this version and see if it works regards, -- Posted via http://www.ruby-forum.com/.