I'm trying to pass a set of pointers between threads using an inproc
socket. On the originating side, they're C++ shared_ptrs. I was thinking of
using an in-place-constructed std::weak_ptr as the message. In order for
this to make sense, I need the following guarantees:

1) Messages will not be moved around with C-style memcpy, etc. I don't know
how weak_ptr (or shared_ptr) would react to this, but it's a bad idea in
general. It can break vtables and stuff like that. I recall reading that
inproc doesn't do any copying, but is this an API guarantee or just an
implementation detail?
2) Messages will not be dropped silently. I think PAIR and PUSH/PULL meet
this requirement. Please confirm----there is NO WAY for these types to drop
messages, correct?

Passing smart pointers around as if they're raw bytes makes me very
nervous, but I think it can be done if it's handled with great care.
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to