Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
96
Proxy Server
izeeshan
1
380
Other Decks in Programming
See All in Programming
Integrating WordPress and Symfony
alexandresalome
0
150
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.3k
AIコーディングエージェント(NotebookLM)
kondai24
0
180
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
6
2.2k
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
130
Microservices rules: What good looks like
cer
PRO
0
1.3k
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
430
ZOZOにおけるAI活用の現在 ~モバイルアプリ開発でのAI活用状況と事例~
zozotech
PRO
8
5.5k
Go コードベースの構成と AI コンテキスト定義
andpad
0
120
SwiftUIで本格音ゲー実装してみた
hypebeans
0
190
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
210
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
9
1.1k
Featured
See All Featured
Context Engineering - Making Every Token Count
addyosmani
9
500
Code Review Best Practice
trishagee
74
19k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.3k
Site-Speed That Sticks
csswizardry
13
1k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.2k
The Cult of Friendly URLs
andyhume
79
6.7k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Bash Introduction
62gerente
615
210k
How GitHub (no longer) Works
holman
316
140k
Side Projects
sachag
455
43k
Code Reviewing Like a Champion
maltzj
527
40k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
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