I keep having deadlock when executing it
What is wrong with the code? I think may be I have to add an other
ConditionVariable, the problem is the producer and the consumer use the
two queues
I keep having deadlock when executing it
What is wrong with the code? I think may be I have to add an other
ConditionVariable, the problem is the producer and the consumer use the
two queues
Any Ideas
When you use mutex.synchronize, it’s going to lock to mutex. When you
call access.wait(), it releases that same mutex and waits for the mutex
to be unlocked. But you have already locked it, and it should/can not
unlock until after the block is finished. I’m not even sure what the
behavior is here, but it’s unlikely to work as you might expect.
I tried simple Queue and it doesn’t work too
because I think it a circular wait, the consumer consume from a queue
but produce new data and push them to the other queue
the producer make the same thing too
and i think that’s why I have deadlock but I don’t know how to solve the
problem
On Sat, Oct 15, 2011 at 3:26 PM, rubix Rubix [email protected]
wrote:
I tried simple Queue and it doesn’t work too
because I think it a circular wait, the consumer consume from a queue
but produce new data and push them to the other queue
the producer make the same thing too
and i think that’s why I have deadlock but I don’t know how to solve the
problem
I still have the deadlock problem
but I have some exceptions in somework of the produced values,
is unhandeled exception can be a cause of the deadlock?
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 :