[zeromq-dev] Java bindings error?

Pieter Hintjens ph at imatix.com
Thu Jun 24 09:07:51 CEST 2010


Contexts are cheap to create but act as the hub for inproc transport, so you
want one context per process.

-Pieter

Sent from my Android mobile phone.

On Jun 24, 2010 2:23 AM, "Stuart Halloway" <stu at thinkrelevance.com> wrote:

If the context represents any real resources on the native side, I would
recommend going in the opposite direction:

(1) Clients should create and hold the context, and explicitly close it when
they are done.

(2) Ditto for sockets (except that creation is via the context).

(3) Neither Context nor Socket should implement finalize.

(4) Instead, they should implement the Closeable interface [1].

How costly is the context? Should it be created once per process? Once per
thread? Something else?

[1] http://java.sun.com/j2se/1.5.0/docs/api/java/io/Closeable.html


> On Wed, Jun 23, 2010 at 5:58 PM, gonzalo diethelm <gdiethelm at dcv.cl>
wrote:
>>> I think you are o...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100624/c666c1a1/attachment.html>


More information about the zeromq-dev mailing list