Re: Threading - How its done?
Re: Threading - How its done?
- Subject: Re: Threading - How its done?
- From: Chris Hanson <email@hidden>
- Date: Wed, 7 May 2008 22:32:26 -0700
On May 6, 2008, at 6:32 PM, Karl von Moller wrote:
With regard to Threading PDF's, while I didn't want to specifically
build for 10.5 only, using NSOperation's or using some sort of
priority queue process - does this offer any protection for
threading PDF activities? As yet I have not used NSOperations but
reading the docs this sounds like it could encapsulate much of the
Threading detail for me.
NSOperation encapsulates the work of managing a thread pool and work
queue.
It does nothing to "protection" to any threading. Multithreading
means allowing multiple flows of control to take place in a single
address space; if you want those different flows of control to
manipulate the same data, you need to synchronize their access to it
-- and you need to be certain you *can* synchronize their access to it.
The latter is why bindings don't just magically work with threads.
They would have to have some way to lock the object graph they're
reading from, and any code working with that object graph would also
have to lock it. And all locking would have to occur in the same
order and without dependencies to prevent deadlock.
-- Chris
_______________________________________________
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