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

Michael Powell mwpowellhtx at gmail.com
Mon Apr 8 18:26:29 CEST 2013


On Mon, Apr 8, 2013 at 10:58 AM, Pieter Hintjens <ph at imatix.com> wrote:

> 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.
>

This is where folks are getting hung up. The answers have been quite dodgy
on the topic until now:


> 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.
>

If I understand it correctly, the thing that is blocked is the Context,
which needs to be protected. There's no getting around this brutal fact.

Should be fairly simple to self-contain in an ACID'ic if SOLID manner,
however.


> You would have to be quite creative to create two tasks that were
> waiting on each other for messages.
>
> -Pieter
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130408/71cfdb07/attachment.htm>


More information about the zeromq-dev mailing list