• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: appendBytes memcpy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: appendBytes memcpy (From: Shawn Erickson <email@hidden>)
 >Re: appendBytes memcpy (From: "roger casaliƱas" <email@hidden>)

  • Prev by Date: Re: appendBytes memcpy
  • Next by Date: Re: appendBytes memcpy
  • Previous by thread: Re: appendBytes memcpy
  • Next by thread: Re: appendBytes memcpy
  • Index(es):
    • Date
    • Thread