On Wed, Jun 23, 2010 at 5:50 PM, Joe Holloway <[email protected]> wrote:
> JNI provides a way for the native code to acquire a "phantom
> reference" [1] to help in this situation (never used it, but I assume
> this is what it's for). The JNI Socket::construct(...) method could
> acquire a reference to the Context object to essentially force their
> lifespans to be the same.  Or, I recall seeing some reference counting
> internal to 0MQ that could maybe be put to use to make sure the native
> context object isn't destroyed until all of it's sockets are
> destroyed.
>

Ignore the bit about "phantom reference", I think I got a bit loopy
when reading the doc.  You'd probably just want the Socket to hold a
strong reference to its Context.
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to