4. •Pthreads : C-based interface for creating
and manipulating threads
•NSThread : Cocoa threads
•Grand Central Dispatch : a
lightweight multithreading engine developed
by Apple Inc
•NSOperation : wrapper for task
7. What is GCD?
• A lightweight multithreading engine
• Uses a thread pool
• Automatically optimizes threading
• Scheduling of tasks
• Uses look-free exclusion rather than mutual
exclusion
8. • define the tasks
• block or function
• add them to an appropriate dispatch queue
dispatch_async(queue, ^{
some_async_work();
});
10. Queue types
• Serial Queues
• only one task running at a time
• user queue or main queue
• Concurrent Queue
• tasks started in order but run concurrently
• 3 priority levels: HIGHT, DEFAULT, LOW
13. Palindromic words
• palindromic words - 回文
• is a word that reads the same forward as it does
backward :“radar”
• problem
• count the palindromic words in a dictionary
radar
wrong
way
yaw
result = 3