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
290
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
53
Multithreading using NSOperation - 2
izeeshan
0
86
Proxy Server
izeeshan
1
370
Other Decks in Programming
See All in Programming
Android 15以上でPDFのテキスト検索を爆速開発!
tonionagauzzi
0
190
変化を楽しむエンジニアリング ~ いままでとこれから ~
murajun1978
0
670
202507_ADKで始めるエージェント開発の基本 〜デモを通じて紹介〜(奥田りさ)The Basics of Agent Development with ADK — A Demo-Focused Introduction
risatube
PRO
6
1.4k
マイコンでもRustのtestがしたい その2/KernelVM Tokyo 18
tnishinaga
0
160
[Codecon - 2025] Como não odiar seus testes
camilacampos
0
100
構文解析器入門
ydah
7
2k
画像コンペでのベースラインモデルの育て方
tattaka
3
1.2k
なぜ今、Terraformの本を書いたのか? - 著者陣に聞く!『Terraformではじめる実践IaC』登壇資料
fufuhu
4
410
新しいモバイルアプリ勉強会(仮)について
uetyo
1
250
ソフトウェア設計とAI技術の活用
masuda220
PRO
26
7.3k
管你要 trace 什麼、bpftrace 用下去就對了 — COSCUP 2025
shunghsiyu
0
220
Constant integer division faster than compiler-generated code
herumi
2
210
Featured
See All Featured
Faster Mobile Websites
deanohume
308
31k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
How to train your dragon (web standard)
notwaldorf
96
6.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
YesSQL, Process and Tooling at Scale
rocio
173
14k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Why Our Code Smells
bkeepers
PRO
337
57k
The Language of Interfaces
destraynor
158
25k
Building an army of robots
kneath
306
45k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
1k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
430
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
880
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