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
0
330
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
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
MLOps Japan 勉強会 #52 - 特徴量を言語を越えて一貫して管理する, 『特徴量ドリブン』な MLOps の実現への試み
taniiicom
2
630
ktr0731/go-mcpでMCPサーバー作ってみた
takak2166
0
120
がんばりすぎないコーディングルール運用術
tsukakei
1
210
#QiitaBash TDDでAIに設計イメージを伝える
ryosukedtomita
2
1.7k
少数精鋭エンジニアがフルスタック力を磨く理由 -そしてAI時代へ-
rebase_engineering
0
150
コードに語らせよう――自己ドキュメント化が内包する楽しさについて / Let the Code Speak
nrslib
6
1.4k
無関心の谷
kanayannet
0
130
CSC307 Lecture 17
javiergs
PRO
0
110
Perlで痩せる
yuukis
1
670
eBPFを用いたAIネットワーク監視システム論文の実装 / eBPF Japan Meetup #4
yuukit
3
720
つよそうにふるまい、つよい成果を出すのなら、つよいのかもしれない
irof
0
240
セキュリティマネジャー廃止とクラウドネイティブ型サンドボックス活用
kazumura
1
150
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
430
65k
Producing Creativity
orderedlist
PRO
346
40k
Building a Modern Day E-commerce SEO Strategy
aleyda
41
7.3k
Raft: Consensus for Rubyists
vanstee
138
7k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
4 Signs Your Business is Dying
shpigford
183
22k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
770
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
52
2.8k
Code Reviewing Like a Champion
maltzj
524
40k
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