[zeromq-dev] inproc: passing an object pointer between threads causing datarace?? (3.2.2 stable release)
Oleg Vazhnev
ovazhnev at gmail.com
Sun May 12 13:40:51 CEST 2013
29.11.2012 22:43, gonzalo diethelm пишет:
>
> Variable "&n" is of type "int**". Are you sure that's what you want to do? Perhaps you mean:
>
> zmq_socket.send(n, sizeof(*n)); // or even sizeof(int)
>
> That is, send an int (allocated on the heap) over the socket.
>
> Seeing as I am jumping into this without much context, please feel free to ignore me.
>
if we want to send int* we should pass int** to zmq_socket.send because
first parameter is pointer to the buffer:
inline size_t send (const void *buf_, size_t len_, int flags_ = 0)
In our case it's pointer to int* i.e. int**.
More information about the zeromq-dev
mailing list