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
400
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
100
DDC 2025: p"AI"r Programming statt Vibe-Coding
phoenixhawk
0
120
EKON 2025 - Agents
phoenixhawk
0
150
EKON 2025 AI Coding
phoenixhawk
0
150
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
220
DWX 2025 - Talk to your data
phoenixhawk
0
77
BASTA! Spring 2025 - Halluzinationen, Prompt Injections & Co.
phoenixhawk
0
250
SEACON 2024 - Talk to your Data
phoenixhawk
0
280
Other Decks in Programming
See All in Programming
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
6.8k
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
180
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
280
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
200
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
270
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
330
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
620
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
290
symfony/aiとlaravel/boost
77web
0
110
自作OSでスライド発表する
uyuki234
0
2.7k
A2UI という光を覗いてみる
satohjohn
1
170
Featured
See All Featured
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
260
Crafting Experiences
bethany
1
190
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
55k
Building AI with AI
inesmontani
PRO
1
1.1k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
790
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
220
Bash Introduction
62gerente
615
220k
The Language of Interfaces
destraynor
162
27k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Balancing Empowerment & Direction
lara
6
1.2k
The browser strikes back
jonoalderson
0
1.3k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
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