FROM : Chris Hanson
DATE : Thu May 08 07:32:26 2008
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
DATE : Thu May 08 07:32:26 2008
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
| Related mails | Author | Date |
|---|---|---|
| Army Research Lab | May 6, 20:30 | |
| glenn andreas | May 6, 20:38 | |
| Karl von Moller | May 7, 01:51 | |
| John Calhoun | May 7, 02:43 | |
| Karl von Moller | May 7, 03:32 | |
| Adam R. Maxwell | May 7, 04:19 | |
| Chris Hanson | May 8, 07:32 |






Cocoa mail archive

