• 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: Multithread communication
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multithread communication


  • Subject: Re: Multithread communication
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 3 Feb 2010 09:49:03 -0800


On Feb 3, 2010, at 8:30 AM, McLaughlin, Michael P. wrote:

but their own. I have to pass these filled structures back to the main
thread upon completion. The last thing each thread does is
postNotificationName to the main thread saying that it is ready to return
lots of data which it does via an NSPointerArray
[ptr pointerArrayWithStrongObjects]
and dictionary. The object which collects the results has a function
getOpResults() which accesses the passed pointer.

My hunch is that the data is sometimes being freed/dealloced before it gets to the main thread. Take a careful look at the memory and refcount management in the code. (Are your data values objects or just structs? You say they're structures, and you're using NSPointerArray, but callijng +pointerArrayWithStrongObjects implies you're putting objects in the array.)


Setting the environment variable MallocScribble can help catch bugs that access freed memory. It causes free() to fill blocks with 0x55 before freeing them, which often causes a crash when something tries to use the freed memory later on.

—Jens_______________________________________________

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: 
 >Multithread communication (From: "McLaughlin, Michael P." <email@hidden>)

  • Prev by Date: Re: Synthesize NSMutableString retain count question
  • Next by Date: Re: Help with NSData dataWithContentsOfURL
  • Previous by thread: Re: Multithread communication
  • Next by thread: Re: Multithread communication
  • Index(es):
    • Date
    • Thread