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
Zeeshan Khan
August 18, 2014
Programming
0
310
Multi-Threading using NSOperation
Zeeshan Khan
August 18, 2014
Tweet
Share
More Decks by Zeeshan Khan
See All by Zeeshan Khan
Core Data Migration
izeeshan
0
55
Multithreading using NSOperation - 2
izeeshan
0
100
Proxy Server
izeeshan
1
390
Other Decks in Programming
See All in Programming
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
2026年 エンジニアリング自己学習法
yumechi
0
130
SourceGeneratorのススメ
htkym
0
190
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
540
AI & Enginnering
codelynx
0
110
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.5k
「ブロックテーマでは再現できない」は本当か?
inc2734
0
130
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
140
Fluid Templating in TYPO3 14
s2b
0
130
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
640
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
450
Featured
See All Featured
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
72
Thoughts on Productivity
jonyablonski
74
5k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
79
The Cost Of JavaScript in 2023
addyosmani
55
9.5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.7k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Crafting Experiences
bethany
1
46
Believing is Seeing
oripsolob
1
53
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.2k
Statistics for Hackers
jakevdp
799
230k
Skip the Path - Find Your Career Trail
mkilby
0
52
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