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
1k
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
EKON 2025 - Agents
phoenixhawk
0
29
EKON 2025 AI Coding
phoenixhawk
0
34
BASTA! 2025: Agents in Action: LLM's, Tools and Reasoning
phoenixhawk
0
30
From Zero to Hero: How to put GPT LLMs & Friends into your Applications
phoenixhawk
0
98
DWX 2025 - Talk to your data
phoenixhawk
0
24
BASTA! Spring 2025 - Halluzinationen, Prompt Injections & Co.
phoenixhawk
0
120
SEACON 2024 - Talk to your Data
phoenixhawk
0
150
MLCon 2024 - Bootcamp: Conquer and Rule Generative AI
phoenixhawk
0
160
InfoDays Generative AI für Developer 2024
phoenixhawk
0
130
Other Decks in Programming
See All in Programming
What's New in Web AI?
christianliebel
PRO
0
120
Eloquentを使ってどこまでコードの治安を保てるのか?を新人が考察してみた
itokoh0405
0
3.1k
ノーコードからの脱出 -地獄のデスロード- / Escape from Base44
keisuke69
0
670
自動テストのアーキテクチャとその理由ー大規模ゲーム開発の場合ー
segadevtech
2
930
Kotlin 2.2が切り拓く: コンテキストパラメータで書く関数型DSLと新しい依存管理のかたち
knih
0
390
開発組織の戦略的な役割と 設計スキル向上の効果
masuda220
PRO
10
2.2k
AI駆動開発ライフサイクル(AI-DLC)のホワイトペーパーを解説
swxhariu5
0
460
AI時代に必須!状況言語化スキル / ai-context-verbalization
minodriven
3
370
SidekiqでAIに商品説明を生成させてみた
akinko_0915
0
130
なぜ強調表示できず ** が表示されるのか — Perlで始まったMarkdownの歴史と日本語文書における課題
kwahiro
8
3.1k
Introducing RemoteCompose: break your UI out of the app sandbox.
camaelon
2
530
Agentに至る道 〜なぜLLMは自動でコードを書けるようになったのか〜
mackee
4
400
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
2.9k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Six Lessons from altMBA
skipperchong
29
4.1k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
970
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
How GitHub (no longer) Works
holman
315
140k
Site-Speed That Sticks
csswizardry
13
960
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
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