[zeromq-dev] Async::Worker, C++ task offloading.

Oliver Smith oliver at kfs.org
Sat Jul 24 10:34:45 CEST 2010


> What you need is to ask 0MQ to allocate the buffer for you (keep in mind
> that for VSMs this doesn't translate to actual malloc/new):
>
> message_t msg (sizeof (ptr));
> *(void**) msg.data () = ptr;
>
> That's it.
>    
Excellent - that's actually what I'm already doing so I'll leave as is 
for now - although ultimately I think I'm going to make message_t a part 
of the worker object so that only one entity needs to be created for the 
whole thing. Then the only issue is figuring out when I need to serialize.

I might do that with separate classes just to keep the underlying code 
as clean as possible.

- Oliver




More information about the zeromq-dev mailing list