Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Multithreading using NSOperation - 2
Search
Zeeshan Khan
August 20, 2014
Programming
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Multithreading using NSOperation - 2
Zeeshan Khan
August 20, 2014
More Decks by Zeeshan Khan
See All by Zeeshan Khan
Core Data Migration
izeeshan
0
65
Proxy Server
izeeshan
1
420
Multi-Threading using NSOperation
izeeshan
0
330
Other Decks in Programming
See All in Programming
우리의 Nitro Modules는 당신의 Turbo Modules보다 아름답다
l2hyunwoo
0
230
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
300
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.4k
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
390
Seven New Principles of Software Engineering
yegor256
0
350
[2026-10-14](C)Re:ゼロから始める異世界生活〜始まりの終わりと終わりの始まり〜
tosite
0
160
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
130
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
150
phperだってパンチカードでコーディングしたい
o0h
PRO
0
480
dotNET_vulnclicker_intro.pdf
deka_morita
0
150
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
4
1.1k
AIがコードを書いてくれる時代、我々は何を確かめるのか
yosuke_furukawa
PRO
12
5k
Featured
See All Featured
エンジニアに許された特別な時間の終わり
watany
109
250k
Paper Plane
katiecoart
PRO
5
54k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
560
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Building Applications with DynamoDB
mza
96
7.3k
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
The Pragmatic Product Professional
lauravandoore
37
7.5k
New Earth Scene 8
popppiees
4
2.7k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
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