• 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: NSXMLParser thread safe?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSXMLParser thread safe?


  • Subject: Re: NSXMLParser thread safe?
  • From: Graham Cox <email@hidden>
  • Date: Sat, 02 Jun 2012 09:18:24 +1000

On 02/06/2012, at 1:55 AM, Nick Zitzmann wrote:

> That depends. How are you creating the thread? It isn't difficult to do using either the pthread or NSThread APIs.


Well, I started with the NSThread method that I've used classically, but moved it over to using NSInvocationOperations in a NSOperationQueue. This second approach is easier, and more stable, but I found a few places where things were going pear shaped, mostly to do with accessing shared caches, which was easily dealt with using @synchronised blocks.

I'm still getting the occasional crash if I let the operation queue perform more than one operation at a time (i.e. it has a limit of 1, but runs it on a thread other than main, and that's OK, but for 2 or more, it sometimes falls over).

I think this has convinced me that there's something not quite thread-safe in my own code, rather than a stack space issue. While SVG parsing can sometimes end up with quite a deep stack, it's not failing specifically under those conditions.

I'll keep working on it....

--Graham
_______________________________________________

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

  • Follow-Ups:
    • Re: NSXMLParser thread safe?
      • From: Kyle Sluder <email@hidden>
References: 
 >Re: NSXMLParser thread safe? (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: iOS preferences outside the application bundle
  • Next by Date: Re: NSXMLParser thread safe?
  • Previous by thread: Re: NSXMLParser thread safe?
  • Next by thread: Re: NSXMLParser thread safe?
  • Index(es):
    • Date
    • Thread