[zeromq-dev] Is it possible to get deadlocks in ZeroMQ applications?

Pieter Hintjens ph at imatix.com
Mon Apr 8 17:58:12 CEST 2013


On Mon, Apr 8, 2013 at 12:31 PM, crocket <crockabiscuit at gmail.com> wrote:

> However, according to one of my IRC fellows, deadlock is a structural
> problem independent of any kind of lock.

This is correct.

> If two ZeroMQ threads waited for each other to finish a task, there would be
> a deadlock.

Yes, in theory. However in practice a deadlock is when both tasks need
resources A and B, and one task gets A and waits for B, and one gets B
and waits for A. In ZeroMQ, tasks share nothing, so they cannot get
half a resource.

You would have to be quite creative to create two tasks that were
waiting on each other for messages.

-Pieter



More information about the zeromq-dev mailing list