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
BASTA! 2021 - Deep Dive in async/await bei Back...
Search
Sebastian Gingter
September 21, 2021
Programming
410
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
BASTA! 2021 - Deep Dive in async/await bei Backend-APIs
Slides zu meinem Vortrag auf der BASTA! 2021.
Sebastian Gingter
September 21, 2021
More Decks by Sebastian Gingter
See All by Sebastian Gingter
Pragmatische AI Agents: Mit LLMs, Tools & Gedächtnis zum Ziel
phoenixhawk
0
110
DDC 2025: p"AI"r Programming statt Vibe-Coding
phoenixhawk
0
120
EKON 2025 - Agents
phoenixhawk
0
160
EKON 2025 AI Coding
phoenixhawk
0
160
BASTA! 2025: Agents in Action: LLM's, Tools and Reasoning
phoenixhawk
0
150
From Zero to Hero: How to put GPT LLMs & Friends into your Applications
phoenixhawk
0
230
DWX 2025 - Talk to your data
phoenixhawk
0
81
BASTA! Spring 2025 - Halluzinationen, Prompt Injections & Co.
phoenixhawk
0
260
SEACON 2024 - Talk to your Data
phoenixhawk
0
290
Other Decks in Programming
See All in Programming
AI時代の仕事技芸論〜ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ(スクフェス仙台 2026バージョン)
kuranuki
0
730
仕様書を書く前にハーネスを作る - Agent Native開発は「探索を速く、判定を固く」
gotalab555
2
440
5分で問診!Composer セキュリティ健康診断
codmoninc
0
650
使用 Meilisearch 建立新聞搜尋工具
johnroyer
0
180
What's New in Android 2026
veronikapj
0
220
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
180
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
390
数百円から始めるRuby電子工作
tarosay
0
110
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
0
310
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
420
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
240
今さら聞けない .NET CLI
htkym
0
140
Featured
See All Featured
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
640
Statistics for Hackers
jakevdp
799
230k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
So, you think you're a good person
axbom
PRO
2
2.1k
Building the Perfect Custom Keyboard
takai
2
820
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.7k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
230
Scaling GitHub
holman
464
140k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
190
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
470
Embracing the Ebb and Flow
colly
88
5.1k
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