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
CSC307 Lecture 04
javiergs
PRO
0
650
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
190
Pythonではじめるオープンデータ分析〜書籍の紹介と書籍で紹介しきれなかった事例の紹介〜
welliving
3
860
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
0
780
Vibe codingでおすすめの言語と開発手法
uyuki234
0
210
AtCoder Conference 2025
shindannin
0
1k
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
560
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
180
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
6
1.7k
Fluid Templating in TYPO3 14
s2b
0
120
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.2k
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
160
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Testing 201, or: Great Expectations
jmmastey
46
8k
Test your architecture with Archunit
thirion
1
2.1k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
110
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
110
Navigating Weather and Climate Data
rabernat
0
82
Automating Front-end Workflow
addyosmani
1371
200k
Odyssey Design
rkendrick25
PRO
1
480
Documentation Writing (for coders)
carmenintech
77
5.2k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Fireside Chat
paigeccino
41
3.8k
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