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
BASTA! Spring 2025 - Halluzinationen, Prompt Injections & Co.
phoenixhawk
0
68
SEACON 2024 - Talk to your Data
phoenixhawk
0
88
MLCon 2024 - Bootcamp: Conquer and Rule Generative AI
phoenixhawk
0
110
InfoDays Generative AI für Developer 2024
phoenixhawk
0
79
EKON 2024 - Prompt Injections, Halluzinationen und Co.
phoenixhawk
0
69
EKON 2024: Real World RAG mit eigenen Daten und Dokumenten
phoenixhawk
0
110
Gen AI Engineering Days - Prompt Injections, Hallucinations and More
phoenixhawk
0
120
Gen AI Engineering Days - Talk to your Data
phoenixhawk
0
92
"Talk to your data": Improving RAG solutions based on real-world experiences
phoenixhawk
0
42
Other Decks in Programming
See All in Programming
テスト分析入門/Test Analysis Tutorial
goyoki
13
2.8k
Effect の双対、Coeffect
yukikurage
4
1.1k
推論された型の移植性エラーTS2742に挑む
teamlab
PRO
0
180
UPDATEがシステムを複雑にする? イミュータブルデータモデルのすすめ
shimomura
0
500
GoのWebAssembly活用パターン紹介
syumai
3
1.1k
Efficiency and Rock 'n’ Roll (Really!)
hollycummins
0
670
Webからモバイルへ Vue.js × Capacitor 活用事例
naokihaba
0
180
統一感のある Go コードを生成 AI の力で手にいれる
otakakot
0
1.8k
Using AI Tools Around Software Development
inouehi
0
900
型付きアクターモデルがもたらす分散シミュレーションの未来
piyo7
0
610
イベントストーミングから始めるドメイン駆動設計
jgeem
3
750
Devinで実践する!AIエージェントと協働する開発組織の作り方
masahiro_nishimi
6
2.8k
Featured
See All Featured
Bash Introduction
62gerente
614
210k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.6k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
KATA
mclloyd
29
14k
How to train your dragon (web standard)
notwaldorf
92
6.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
YesSQL, Process and Tooling at Scale
rocio
172
14k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
770
Done Done
chrislema
184
16k
Why Our Code Smells
bkeepers
PRO
337
57k
Rebuilding a faster, lazier Slack
samanthasiow
81
9k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
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