[zeromq-dev] Fwd: Re: New Python bindings

Brian Granger ellisonbg at gmail.com
Mon Feb 15 02:53:03 CET 2010


Jon,

> Is this is safe? After calling send, the msg is passed to an IO thread ?
>
> That means there are now two threads concerned with the lifetime of memory
> of the string (python and the zmq io thread?)

You raise a good point.  I had forgot that the msg is not sent immediately.

> I see you call zmq_msg_init_data with NULL for the free function, but there is
> still the case that the python thread could destroy the string before the io
> thread uses it? I would expect you to have to pass a free function,
> and manipulate the string in send to increase the refcount, and the free
> function to decrease the refcount.

Yes, this is definitely the way to handle it.  Thanks for catching
this, I will fix this.

> Caveat: I havent ever used Cython before, but have used SIP which is used to
> (Wrap Qt for PyQt) for my own C++.

All the same ideas though.

Thanks and cheers,

Brian

> cheers
>
> jon
>
>
>
>
>> * Better error handling.
>> * A build system (setup.py) that is standalone and a bit more configurable.
>> * New send_json/revc_json and send_pyobj/recv_pyobj methods of Socket that
>> allow you to send Python objects as messages using Python's pickle
>> serialization or json.
>>
>> The only part of the API that I have not wrapped is zmq_poll.  This is
>> next on my list.  But first, I want to understand the design of
>> zmq_poll a bit better.  I have started a thread to discuss those
>> things.
>>
>> I have licensed this code as LGLP and am fine with it being pulled
>> into the main zeromq repo if that is wanted.
>>
>> Cheers,
>>
>> Brian
>>
>>
>> --
>> Brian E. Granger, Ph.D.
>> Assistant Professor of Physics
>> Cal Poly State University, San Luis Obispo
>> bgranger at calpoly.edu
>> ellisonbg at gmail.com
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>
>
>
> -------------------------------------------------------
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



-- 
Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu
ellisonbg at gmail.com



More information about the zeromq-dev mailing list