nothing is limitless & every problem has a solution
Clock Speed
A time unit
3
Slide 4
Slide 4 text
Thread
‘Kernel-level’ + ‘Application-level’ Data Structures
An application can use multiple cores by creating multiple
threads.
4
Parallel Computation
Asynchronous Solution
Slide 5
Slide 5 text
Key Terms
• Process
• Thread (Safe / Un-Safe)
• Task
• Concurrent / Non-Concurrent
• Concurrent vs Parallel
5
Slide 6
Slide 6 text
NSThread
POSIX (Mavericks is 100% POSIX conferment)
6
Life Cycle
Slide 7
Slide 7 text
Hazard of Threaded
Programming
• UIKit access
• Database access
• Stale result
• Cancellation
• De-allocation
7
Slide 8
Slide 8 text
Solutions
• Operations (Current Session)
• GCD (Next Session)
• Notification Queue
• Asynchronous (Hopefully Next to Next Session)
• Timers
8
Slide 9
Slide 9 text
NS Operation
to the rescue
9
Slide 10
Slide 10 text
NS Operations
• Manage all threaded code
• Model asynchronous operations
• KVO Support
• Dependencies
• Priorities
10
Slide 11
Slide 11 text
NS Operation II
• Thread Confinement
• Completion Block
• Cancellation
• Concurrent vs Non-Concurrent
• Some Caveats...
11