[zeromq-dev] CZMQ question re: use of zpoller
Brett Viren
brett.viren at gmail.com
Wed Apr 22 15:38:40 CEST 2020
Hi again,
Johnny Depp <sdusa at hotmail.com> writes:
> Yes, the pull socket is in only one thread
Okay. Then I guess something else is going on.
> However, I switched to sending chunks of memory using zsock_brecv and
> zsock_bsend. And I am back to no reaction. At all.
Maybe no longer relevant but just one multi-thread related comment:
these "b" variants make use of ZeroMQ's "more" feature. Each CZMQ frame
is passed to/from libzmq one at a time so state is kept behind the
scenes. This is one particular case I've been cautioned (when I went
down the road of using thread-spanning sockets) will lead to problems.
> But I will recompile the library with the SERVER/CLIENT draft and see
> if that works better.
This will not be needed if indeed your sockets live entirely in one
thread.
But, if you do go to these thread-safe sockets one restriction we must
live with is that all messages will need to be "single-part". So, the
"b" send/recv variants including "picture" messages of CZMQ won't work.
However, any multi-part zmsg_t can be encoded into a single-part
zframe_t using CZMQ zmsg_encode() just prior to a send and returned to a
multi-part zmsg_t with a zmsg_decode() just after a recv.
-Brett.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20200422/9d063098/attachment.sig>
More information about the zeromq-dev
mailing list