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
Multithreading using NSOperation - 2
Search
Zeeshan Khan
August 20, 2014
Programming
110
0
Share
Multithreading using NSOperation - 2
Zeeshan Khan
August 20, 2014
More Decks by Zeeshan Khan
See All by Zeeshan Khan
Core Data Migration
izeeshan
0
56
Proxy Server
izeeshan
1
390
Multi-Threading using NSOperation
izeeshan
0
320
Other Decks in Programming
See All in Programming
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
410
レガシーPHP転生 〜父がドメインエキスパートだったのでDDD+Claude Codeでチート開発します〜
panda_program
0
900
「話せることがない」を乗り越える 〜日常業務から登壇テーマをつくる思考法〜
shoheimitani
4
790
JAWS-UG横浜 #100 祝・第100回スペシャルAWS は VPC レスの時代へ
maroon1st
0
130
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
240
ハンズオンで学ぶクラウドネイティブ
tatsukiminami
0
130
「Linuxサーバー構築標準教科書」を読んでみた #ツナギメオフライン.7
akase244
0
1.4k
おれのAgentic Coding 2026/03
tsukasagr
1
140
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
1
320
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
330
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
3
310
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
190
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Being A Developer After 40
akosma
91
590k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
340
Technical Leadership for Architectural Decision Making
baasie
3
320
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
240
Scaling GitHub
holman
464
140k
Tell your own story through comics
letsgokoyo
1
890
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
170
Become a Pro
speakerdeck
PRO
31
5.9k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
810
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.6k
Transcript
Multi - Threading using NSOperation by zeeshan 1 Using Blocks
& GCD and Using Asynchronous APIs
• Please point out, if anything is wrong. • Please
stop me & raise your voice, for: • Going too fast... • Not getting anything... • Any doubts... • Any inclusion from your side. 2
Central Processing Unit 3
• Why CPU is in the first slide? • How
early days of computing works? • What do we understand by cores? • How does these came into existence? • How does it effect our system? 4 CPU
nothing is limitless & every problem has a solution Clock
Speed A time unit 5
Clock Speed • What is Clock Speed? • Any problem
with it? • Any solution for that? • How to use these cores? How to take advantage of extra cores? 6
Thread ‘Kernel-level’ + ‘Application-level’ Data Structures An application can use
multiple cores by creating multiple threads. 7 Parallel Computation Asynchronous Solution
Threads • What is Thread? • What are the problems
it solves? (Advantages?) • Does anyone can create thread APIs or any standard follows? • What does Objective C do about thread? 8
Key Terms • Process • Thread • Task (Any diagram?)
• Concurrent / Non-Concurrent • Thread Safe / Thread Un-Safe (Any diagram?) X
NSThread POSIX (Mavericks is 100% POSIX conferment) 9 Life Cycle
NSThread • In which framework is it written? • What
is the lifecycle? • What is it based on? • How can we use it? (Any code?) 10
Is Thread a Problem • It is a right solution?
• What are the cost of using it? • When does problem arise? and Why? • Who gets the burden of it? • How does Thread is different from Process and Task? (Any visual show?) 11
Hazard of Threaded Programming • UIKit access • Database access
• Stale result • Cancellation • De-allocation 12
Solutions • Operations (Current Session) • GCD (Next Session) •
Notification Queue • Asynchronous (Hopefully Next to Next Session) • Timers 13
NS Operation to the rescue 14
NS Operation • When does it introduced? • What is
it actually and how it does? • How to use it? • How many times I can use one operation? • What are the features? 15
NS Operation II • Manage all threaded code • Model
asynchronous operations • KVO Support (Any APIs) • Dependencies (Any APIs) • Priorities (Any APIs) 16
NS Operation III • Thread Confinement • Completion Block (Any
APIs?) • Cancellation • Concurrent vs Non-Concurrent • Some Caveats... 17
NS Operation Queue • Simpler, Name it • Add, Ready
& Execute, Cancel | Finish • Pending Operations (Operations vs OperationCounts) • Multiple Queues • Threads & Queues (How many threads?) 18
NS Operations Queue II • Queue Width (Any APIs?) •
Pause (Suspended) Queues • Cancellation • KVC Compliant (APIs?) • Add Operation with Blocks 19
NS Operations - Use • Blocks • Concrete sub classes
• Selector • Block • User defined sub classes 20
References: • Multithreading Using NSOperation (http:// izeeshan.wordpress.com/2014/08/17/multi-threading- using-nsoperation/) • Threading
Programming Guide • Concurrency Programming Guide • API References (NSOperation and NSOperationQueue) 21
Lets Revise 22 • CPU / Clock Speed • Thread
Solutions and Problems • Process, Thread, Task, Concurrency, • Safe, Un-Safe, Parallel • Operation, Queue,
Demo Use of NS Operation and its queue 23
Any Questions? Thank you! http://izeeshan.wordpress.com/ 24
25 @zeeshan_khan