Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Multi-Threading using NSOperation
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Zeeshan Khan
August 18, 2014
Programming
320
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Multi-Threading using NSOperation
Zeeshan Khan
August 18, 2014
More Decks by Zeeshan Khan
See All by Zeeshan Khan
Core Data Migration
izeeshan
0
61
Multithreading using NSOperation - 2
izeeshan
0
120
Proxy Server
izeeshan
1
400
Other Decks in Programming
See All in Programming
Go 1.27 における memory allocation の高速化
andpad
0
300
「つくるAI」だけではバグは見つからない ~テストに必要な「見つけるAI」を分離させる戦略~
mfunaki
0
160
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
260
初めての模倣学習とVLA
natsutan
0
190
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
100
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
2
420
170k Jobs a Day on GKE: Scaling Mercari's CI Platform - and What's Next for AI-Native Development
junyaokabe
0
120
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
420
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
160
そこに3びきプロダクトがいるじゃろう——生成AI時代における“価値が届かない理由”の構造
kosuket
0
560
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
170
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
350
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
174
15k
Claude Code のすすめ
schroneko
67
230k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
810
Joys of Absence: A Defence of Solitary Play
codingconduct
1
440
New Earth Scene 8
popppiees
3
2.5k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Everyday Curiosity
cassininazir
0
290
Optimizing for Happiness
mojombo
378
71k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
430
The Mindset for Success: Future Career Progression
greggifford
PRO
0
470
Typedesign – Prime Four
hannesfritz
42
3.1k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
480
Transcript
Multi - Threading by zeeshan 1
CPU Why do we have n number of Core(s)? 2
nothing is limitless & every problem has a solution Clock
Speed A time unit 3
Thread ‘Kernel-level’ + ‘Application-level’ Data Structures An application can use
multiple cores by creating multiple threads. 4 Parallel Computation Asynchronous Solution
Key Terms • Process • Thread (Safe / Un-Safe) •
Task • Concurrent / Non-Concurrent • Concurrent vs Parallel 5
NSThread POSIX (Mavericks is 100% POSIX conferment) 6 Life Cycle
Hazard of Threaded Programming • UIKit access • Database access
• Stale result • Cancellation • De-allocation 7
Solutions • Operations (Current Session) • GCD (Next Session) •
Notification Queue • Asynchronous (Hopefully Next to Next Session) • Timers 8
NS Operation to the rescue 9
NS Operations • Manage all threaded code • Model asynchronous
operations • KVO Support • Dependencies • Priorities 10
NS Operation II • Thread Confinement • Completion Block •
Cancellation • Concurrent vs Non-Concurrent • Some Caveats... 11
NS Operation Queue • Simpler, Name it • Add, Ready
& Execute, Cancel | Finish • Pending Operations • Multiple Queues • Threads & Queues 12
NS Operations Queue II • Queue Width • Pause (Suspended)
Queues • Cancellation • KVC Compliant • Add Operation with Blocks 13
NS Operations - Use • Blocks • Concrete sub classes
• Selector • Block • User defined sub classes 14
References: • Multithreading Using NSOperation (http:// izeeshan.wordpress.com/2014/08/17/multi-threading- using-nsoperation/) • Concurrency
Programming Guide • Threading Programming Guide • API References 15
Any Questions? Thank you! @zeeshan_khan http://izeeshan.wordpress.com/ 16
17 @zeeshan_khan