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 Backend-APIs
Search
Sebastian Gingter
September 21, 2021
Programming
0
240
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
Webinar: Schutz vor Halluzinationen und Prompt Injections
phoenixhawk
0
27
DWX 2024 - Advanced RAG
phoenixhawk
0
69
Generative_AI_Infodays_-_Prompt_Injections_Halluzinationen_und_Co_-_LLMs_sicher_in_die_Schranken_weisen.pdf
phoenixhawk
0
45
Warum versteht mich der Computer auf einmal? Wir lüften das Geheimnis von Embeddings
phoenixhawk
0
45
Schutz vor Halluzinationen und Prompt Injections: Absicherung von LLM-Integrationen in Business-Apps
phoenixhawk
1
240
Generative AI: Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials
phoenixhawk
0
68
Webinar: Moderne Semantische Suche mit LLMs, Vektor-Datenbanken und LangChain
phoenixhawk
0
320
BASTA 2023 Blazor Statemanagement
phoenixhawk
0
65
.NET 7 Web-APIs mit Turbo: Deep-Dive in async/await
phoenixhawk
0
260
Other Decks in Programming
See All in Programming
HMSコンペ 11th Solution (team : kansai-kaggler)
t88
1
680
Modern Angular: Renovation for Your Applications
manfredsteyer
PRO
0
140
CSC307 Lecture 05
javiergs
PRO
0
210
MIERUNE BBQにおけるユーザー中心設計()
mierune
PRO
1
110
わかりやすい正解を捨てて、コトに向き合う - スクラムフェス金沢2024 スポンサーセッション
yusukekokubo
0
170
TiDB Serverless ~理想のServerless DBを考える~
soso_15315
1
160
君たちはどうコードをレビューする (される) か / 大吉祥寺.pm
utgwkk
15
8.5k
最古の関数型言語「Lisp」ことはじめ / lisp_in_kamiyama
uhooi
1
190
Introduction of Happy Eyeballs Version 2 (RFC8305) to the Socket library
coe401_
1
220
Cloudflare Workers x AWS Lambdaの組み合わせユースケース / Cloudflare Workers x AWS Lambda Combination Use Case
seike460
PRO
2
310
実用的かつリーズナブルな 「Azure × Gemini × LINE」~キャラクターBot 実装ライブデモ~
tomodo_ysys
1
170
大規模マルチテナントを解決するYugabyteDBという選択肢
nnaka2992
1
250
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
64
5.2k
Raft: Consensus for Rubyists
vanstee
134
6.5k
The Cult of Friendly URLs
andyhume
75
5.9k
Building Applications with DynamoDB
mza
89
5.8k
Teambox: Starting and Learning
jrom
130
8.6k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
44
4.7k
Stop Working from a Prison Cell
hatefulcrawdad
266
20k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
26
2.1k
Optimising Largest Contentful Paint
csswizardry
18
2.6k
Building Flexible Design Systems
yeseniaperezcruz
323
37k
Fontdeck: Realign not Redesign
paulrobertlloyd
79
5.1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
26
1.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