Jump to content

Is a Data copy made when dequeuing an element and requeueing somewhere else?

Recommended Posts

Hi Guys,


I've started sending some really big messages around my application and I was wondering if memory is allocated at each message handler? See the following code pic for an example:



More generally, what are the best ways to pass around massive data blocks (100s of MB) between processes?



Link to post

Enqueue/Dequeue does not make a copy, so queues are a good choice here. Of course, if you enqueue data and continue to modify it at the same time, after it's already in the queue, then you'll force a copy because you'll need to have one copy in the queue and another to modify, so make sure that the wire ends at the enqueue. Preview Queue will make a copy of the data, since one copy needs to stay in the queue.

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.