Re: appendBytes memcpy
Re: appendBytes memcpy
- Subject: Re: appendBytes memcpy
- From: "stephen joseph butler" <email@hidden>
- Date: Thu, 2 Aug 2007 01:13:00 -0500
On 8/2/07, roger casaliƱas <email@hidden> wrote:
> Is there a way to remove used bytes from the earlier part of the buffer (the
> bytes that were appended earlier)? It's not possible for me to release the
> buffer since another thread is reading off of the buffer in a slow pace. I
> was wondering if the reader can take off the bytes it has read (so the
> buffer wont reach near a GB that fast)?
You are using locks to guarantee exclusive access to the
NSMutableData... right? None of the mutable objects in the Foundation
framework are thread safe.
If you're just trying to pass bytes from one thread to another, I
suggest you lookup the producer-consumer problem. There are better
ways than just adding it to the end of one huge buffer (unless your
design explicitly needs that).
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden