On Mon, Mar 28, 2011 at 7:48 PM, gonzalo diethelm <[email protected]> wrote:
>> How would you implement this without using globals? > Something like this: > > int ctx = zmq_init(); > int sock = zmq_socket(ctx, TYPE); > // From now on, passing sock implicitly passes in ctx as well The problem is that you need to convert ctx into a pointer to the actual context structure, so that you can convert the socket handle into a pointer, so you can access e.g. socket queues. Thus you need a global lock-safe data structure. -Pieter _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
