Re: NSXMLParser in background thread crashing
Re: NSXMLParser in background thread crashing
- Subject: Re: NSXMLParser in background thread crashing
- From: "Philip Q" <email@hidden>
- Date: Fri, 23 Feb 2007 18:16:30 +1300
On 23/02/07, Jim Correia <email@hidden> wrote:
On Feb 22, 2007, at 9:36 AM, Justin R. Miller wrote:
> 2) There is something related to threading that is causing this.
I don't see it mentioned in the class doc for NSXMLParser, or in the
Cocoa Thread Safety docs, that NSXMLParser is thread safe.
Absent any reference that it is (which I may have missed), you cannot
assume that it can be safely used anywhere but on the main thread.
This isn't what thread safety means -- a thread safe class can be used
from multiple threads without using locks. Large parts of
Foundation/AppKit aren't thread safe, but are safe for using within a
single thread.
There shouldn't be any problem with using an NSXMLParser in a separate
thread. What is a bit suspicious, is the NSAutoreleaePool being added
to -parse. Why is it being added?
-Phil
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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