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
Thinktecture Webinar: Web-API mit Turbo:Deep-d...
Search
Sebastian Gingter
February 16, 2022
Programming
0
980
Thinktecture Webinar: Web-API mit Turbo: Deep-dive in async/await für Backend-APIs
Slides for my webinar.
Sebastian Gingter
February 16, 2022
Tweet
Share
More Decks by Sebastian Gingter
See All by Sebastian Gingter
DWX 2025 - Talk to your data
phoenixhawk
0
7
BASTA! Spring 2025 - Halluzinationen, Prompt Injections & Co.
phoenixhawk
0
75
SEACON 2024 - Talk to your Data
phoenixhawk
0
98
MLCon 2024 - Bootcamp: Conquer and Rule Generative AI
phoenixhawk
0
120
InfoDays Generative AI für Developer 2024
phoenixhawk
0
93
EKON 2024 - Prompt Injections, Halluzinationen und Co.
phoenixhawk
0
80
EKON 2024: Real World RAG mit eigenen Daten und Dokumenten
phoenixhawk
0
110
Gen AI Engineering Days - Prompt Injections, Hallucinations and More
phoenixhawk
0
130
Gen AI Engineering Days - Talk to your Data
phoenixhawk
0
100
Other Decks in Programming
See All in Programming
Kotlin エンジニアへ送る:Swift 案件に参加させられる日に備えて~似てるけど色々違う Swift の仕様 / from Kotlin to Swift
lovee
1
260
チームで開発し事業を加速するための"良い"設計の考え方 @ サポーターズCoLab 2025-07-08
agatan
0
170
AIコーディング道場勉強会#2 君(エンジニア)たちはどう生きるか
misakiotb
1
290
ruby.wasmで多人数リアルタイム通信ゲームを作ろう
lnit
3
430
PHPでWebSocketサーバーを実装しよう2025
kubotak
0
270
Result型で“失敗”を型にするPHPコードの書き方
kajitack
5
600
ISUCON研修おかわり会 講義スライド
arfes0e2b3c
1
410
スタートアップの急成長を支えるプラットフォームエンジニアリングと組織戦略
sutochin26
0
4k
新メンバーも今日から大活躍!SREが支えるスケールし続ける組織のオンボーディング
honmarkhunt
3
5.8k
プロダクト志向なエンジニアがもう一歩先の価値を目指すために意識したこと
nealle
0
130
A full stack side project webapp all in Kotlin (KotlinConf 2025)
dankim
0
100
童醫院敏捷轉型的實踐經驗
cclai999
0
210
Featured
See All Featured
Speed Design
sergeychernyshev
32
1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
52k
Music & Morning Musume
bryan
46
6.6k
Facilitating Awesome Meetings
lara
54
6.4k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
Optimizing for Happiness
mojombo
379
70k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
500
The Pragmatic Product Professional
lauravandoore
35
6.7k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
A designer walks into a library…
pauljervisheath
207
24k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
Transcript
None
2 Deep-dive in async/await bei Backend-APIs ▪ 🐻💬 ▪ ▪
▪ ▪ ▪ ▪ ▪ ▪ Twitter:
3 ▪ ▪ ▪ ▪ ▪ Deep-dive in async/await bei
Backend-APIs
4 ▪ ▪ ▪ ▪ ▪ ▪ Deep-dive in async/await
bei Backend-APIs
5 Deep-dive in async/await bei Backend-APIs Nein, aber effizienter!
6 Deep-dive in async/await bei Backend-APIs
7 ▪ ▪ ▪ ▪ ▪ ▪ ▪ Deep-dive in
async/await bei Backend-APIs
8 Deep-dive in async/await bei Backend-APIs Kern 1 Kern 2
Kern 3 Kern 4 P2 T1 P2 T2 P3 T1 P1 T2 P3 T2 OS Scheduler P1 T1
9 • • • ▪ ▪ ▪ ▪ ▪ Deep-dive
in async/await bei Backend-APIs * Zahlen für Windows, Quelle: “Windows Internals“, Solomin, Russinovich et al. Jeffrey Richter sagt hingegen: 30 ms in Windows, Linux hat andere Zeiten…
10 • • • • • • • • •
• Deep-dive in async/await bei Backend-APIs
11 Deep-dive in async/await bei Backend-APIs Kern 1 Kern 2
Kern 3 Kern 4 P2 T1 P2 T2 P3 T1 P1 T1 P3 T2 P1 T2 Kontext- Wechsel Kontext- & Prozess- Wechsel
12 • • • • • • • • •
Deep-dive in async/await bei Backend-APIs
13 Deep-dive in async/await bei Backend-APIs ALU & FPU Registers
0 Registers 1 CPU Core with Hyper-Threading Classic CPU Core
14 Deep-dive in async/await bei Backend-APIs Kern 1 Kern 2
Kern 3 Kern 4 P2 T1 P2 T2 MyProc T1 P1 T2 P1 T1 MyProc T2 MyProc T3 MyProc T4 MyProc T5 MyProc T7 MyProc T6
15 Deep-dive in async/await bei Backend-APIs • • • Quelle:
“Systems Performance: Enterprise and the Cloud“, 2013, Brendan Gregg, Pearson Verlag
16 Deep-dive in async/await bei Backend-APIs • • • •
• •
17 Deep-dive in async/await bei Backend-APIs
18 ▪ ▪ ▪ ▪ ▪ ▪ ⏳ ▪ ▪
▪ Deep-dive in async/await bei Backend-APIs ReadFile API: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-readfile
19 ▪ ▪ ▪ ▪ ▪ ▪ ⏳ ▪ Deep-dive
in async/await bei Backend-APIs ReadFile API: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-readfile
20 Deep-dive in async/await bei Backend-APIs
21 Deep-dive in async/await bei Backend-APIs • • IAsyncResult BeginSomething()
• EndSomething(result) • • DoSomethingAsync() • event SomethingCompleted • • Task[<T>] DoSomethingAsync() P
22 Deep-dive in async/await bei Backend-APIs
23 • • • • • • .ContinueWith() • Deep-dive
in async/await bei Backend-APIs
24 Deep-dive in async/await bei Backend-APIs Task Task-Liste Threadpool T1
Threadpool T2 Kern 1 Kern 3 Kern 2 Kern 4 Threadpool T3 Threadpool T4 Threadpool Management Jeder Pool-Thread arbeitet Tasks in einer Endlosschleife ab Completed Tasks
25 • • • • • 🤯 • • Deep-dive
in async/await bei Backend-APIs
26 Deep-dive in async/await bei Backend-APIs
27 • • async Task<> MyMethodAsync() • • • await
OtherMethodAsync() • • await • • • • Deep-dive in async/await bei Backend-APIs E
28 Deep-dive in async/await bei Backend-APIs
29 Deep-dive in async/await bei Backend-APIs P
30 • • task.GetAwaiter().GetResult() → ❌ • Thread.Sleep() → ❌
• await Task.Delay() → ✔ • Thread.SpinWait() • → ❌ • → ✔ Deep-dive in async/await bei Backend-APIs
31 • • var task1 = DoSomethingAsync(); var task2 =
DoSomethingElseAsync(); await Task.WhenAll(task1, task2); • • • Task.Factory.StartNew(…, TaskCreationOptions.LongRunning); • • • Deep-dive in async/await bei Backend-APIs
32 • • • • Deep-dive in async/await bei Backend-APIs
33 Deep-dive in async/await bei Backend-APIs
34 ▪ ▪ ▪ ▪ ▪ ▪ Deep-dive in async/await
bei Backend-APIs
35 ▪ ▪ ▪ ▪ ▪ 😉 Deep-dive in async/await
bei Backend-APIs P
None