[zeromq-dev] Destroying context with CZMQ

Pieter Hintjens ph at imatix.com
Thu Jul 25 15:23:24 CEST 2013


Hi Michaël, sorry CZMQ doesn't have its own Guide yet. The pattern we
aim for is new/destroy in pairs, so if you don't create a context in a
thread, you don't destroy it in a thread. If you do create it, you do
also destroy it, otherwise you will get memory leaks.

There are many multitthreaded examples in the Guide you can look at.

On Wed, Jul 24, 2013 at 3:53 PM, Michaël Melchiore <rohel01 at gmail.com> wrote:
>
> Hello all,
>
> From CZMQ documentation, I understand that threads created with zthread_fork
> will automatically destroy their context upon exit.
>
> Yet, it is not clear to me if calling zctx_destroy in the parent thread is
> required. What if I am using it for other communications that do not involve
> the child zthread ?
>
> Regards,
>
> Michaël
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



More information about the zeromq-dev mailing list