Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
BASTA! 2021 - Deep Dive in async/await bei Back...
Search
Sebastian Gingter
September 21, 2021
Programming
0
360
BASTA! 2021 - Deep Dive in async/await bei Backend-APIs
Slides zu meinem Vortrag auf der BASTA! 2021.
Sebastian Gingter
September 21, 2021
Tweet
Share
More Decks by Sebastian Gingter
See All by Sebastian Gingter
DDC 2025: p"AI"r Programming statt Vibe-Coding
phoenixhawk
0
26
EKON 2025 - Agents
phoenixhawk
0
45
EKON 2025 AI Coding
phoenixhawk
0
50
BASTA! 2025: Agents in Action: LLM's, Tools and Reasoning
phoenixhawk
0
43
From Zero to Hero: How to put GPT LLMs & Friends into your Applications
phoenixhawk
0
120
DWX 2025 - Talk to your data
phoenixhawk
0
28
BASTA! Spring 2025 - Halluzinationen, Prompt Injections & Co.
phoenixhawk
0
140
SEACON 2024 - Talk to your Data
phoenixhawk
0
170
MLCon 2024 - Bootcamp: Conquer and Rule Generative AI
phoenixhawk
0
190
Other Decks in Programming
See All in Programming
Cell-Based Architecture
larchanjo
0
130
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.3k
WebRTC と Rust と8K 60fps
tnoho
2
2k
著者と進める!『AIと個人開発したくなったらまずCursorで要件定義だ!』
yasunacoffee
0
150
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
1
290
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
270
Deno Tunnel を使ってみた話
kamekyame
0
150
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
440
ゲームの物理 剛体編
fadis
0
350
dotfiles 式年遷宮 令和最新版
masawada
1
790
関数実行の裏側では何が起きているのか?
minop1205
1
710
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
510
Featured
See All Featured
エンジニアに許された特別な時間の終わり
watany
105
220k
How GitHub (no longer) Works
holman
316
140k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Deep Space Network (abreviated)
tonyrice
0
16
Code Review Best Practice
trishagee
74
19k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.1k
Designing Experiences People Love
moore
143
24k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Context Engineering - Making Every Token Count
addyosmani
9
540
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
75
Transcript
Thinktecture AG | Consultant
3 Deep-dive in async/await bei Backend-APIs
4 Deep-dive in async/await bei Backend-APIs ▪ ▪ ▪ ▪
▪ ▪ ▪ ▪ ▪ Twitter:
5 ▪ ▪ ▪ ▪ ▪ Deep-dive in async/await bei
Backend-APIs
6 ▪ ▪ ▪ ▪ ▪ ▪ Deep-dive in async/await
bei Backend-APIs
7 Deep-dive in async/await bei Backend-APIs Nein, aber effizienter!
8 Deep-dive in async/await bei Backend-APIs
9 ▪ ▪ ▪ ▪ ▪ ▪ ▪ Deep-dive in
async/await bei Backend-APIs
10 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
11 • • • ▪ ▪ ▪ ▪ ▪ 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…
12 • • • • • • • • •
• Deep-dive in async/await bei Backend-APIs
13 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
14 • • • • • • • • •
Deep-dive in async/await bei Backend-APIs
15 Deep-dive in async/await bei Backend-APIs ALU & FPU Registers
0 Registers 1 CPU Core with Hyper-Threading Classic CPU Core
16 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
17 Deep-dive in async/await bei Backend-APIs • • • Quelle:
“Systems Performance: Enterprise and the Cloud“, 2013, Brendan Gregg, Pearson Verlag
18 Deep-dive in async/await bei Backend-APIs • • • •
• •
19 Deep-dive in async/await bei Backend-APIs
20 • • • • • • .ContinueWith() • Deep-dive
in async/await bei Backend-APIs
21 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
22 • • • • • 🤯 Deep-dive in async/await
bei Backend-APIs
23 Deep-dive in async/await bei Backend-APIs
24 ▪ ▪ ▪ ▪ ▪ ▪ ⏳ ▪ ▪
▪ Deep-dive in async/await bei Backend-APIs ReadFile API: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-readfile
25 ▪ ▪ ▪ ▪ ▪ ▪ ⏳ ▪ Deep-dive
in async/await bei Backend-APIs ReadFile API: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-readfile
26 Deep-dive in async/await bei Backend-APIs • • IAsyncResult BeginSomething()
• EndSomething(result) • • DoSomethingAsync() • event SomethingCompleted • • Task[<T>] DoSomethingAsync()
27 Deep-dive in async/await bei Backend-APIs
28 • • async Task<> MyMethodAsync() • • • await
OtherMethodAsync() • • await • • • • Deep-dive in async/await bei Backend-APIs
29 Deep-dive in async/await bei Backend-APIs
30 Deep-dive in async/await bei Backend-APIs
31 • • task.GetAwaiter().GetResult() → ❌ • Thread.Sleep() → ❌
• await Task.Delay() → ✔ • Thread.SpinWait() • → ❌ • → ✔ Deep-dive in async/await bei Backend-APIs
32 • • var task1 = DoSomethingAsync(); var task2 =
DoSomethingElseAsync(); await Task.WhenAll(task1, task2); • • • Task.Factory.StartNew(…, TaskCreationOptions.LongRunning); • • • 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
36 ▪ ▪ ▪ ▪ ▪ 😉 Deep-dive in async/await
bei Backend-APIs
None