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

Martin Sustrik sustrik at 250bpm.com
Mon Feb 15 18:51:20 CET 2010


Brian,

> I will add a copy keyword argument to the send method and set the
> default to True.
> If False is set, I will use the dealloc. function that mucks with the
> GIL and refcount.
> But the default will be to copy.

GIL requires true mutex-like behaviour, ie. cache synchronisation 
between CPU cores, right?

If so, our measurements shows that copying is relatively cheap as 
compared to cache synchronisation. Thus, it makes sense to use GIL only 
for very large messages (several MB).

As for the API, my suggestion would be to allow changing the behavior 
using a socket option rather than changing the signature of the send 
function. That way people don't have to care about the issue unless they 
have extreme latency requirements.

Martin



More information about the zeromq-dev mailing list