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 async/await in .NET
Search
Sebastian Gingter
May 19, 2021
Technology
0
460
Thinktecture Webinar async/await in .NET
Slides for my webinar about async/await in .NET.
Sebastian Gingter
May 19, 2021
Tweet
Share
More Decks by Sebastian Gingter
See All by Sebastian Gingter
InfoDays Generative AI für Developer 2024
phoenixhawk
0
8
EKON 2024: Real World RAG mit eigenen Daten und Dokumenten
phoenixhawk
0
27
Gen AI Engineering Days - Prompt Injections, Hallucinations and More
phoenixhawk
0
28
Gen AI Engineering Days - Talk to your Data
phoenixhawk
0
21
"Talk to your data": Improving RAG solutions based on real-world experiences
phoenixhawk
0
20
cim Lingen 2024 - Wieso versteht mich der Computer auf einmal? - Wir lüften das Geheimnis von Embeddings
phoenixhawk
0
26
cim Lingen 2024 - Prompt Injections, Halluzinationen & Co. - LLMs sicher in die Schranken weisen
phoenixhawk
0
26
BASTA! 2024: Real-World RAG: Eigene Daten & Dokumente mit semantischer Suche & LLMs erschließen
phoenixhawk
0
38
AI in Action mit GPT & Co. – Sprachzentrierte Business-Anwendungen mit Large Language Models
phoenixhawk
0
75
Other Decks in Technology
See All in Technology
複雑なState管理からの脱却
sansantech
PRO
1
140
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.7k
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
120
DMARC 対応の話 - MIXI CTO オフィスアワー #04
bbqallstars
1
160
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
スクラムチームを立ち上げる〜チーム開発で得られたもの・得られなかったもの〜
ohnoeight
2
350
Taming you application's environments
salaboy
0
180
[CV勉強会@関東 ECCV2024 読み会] オンラインマッピング x トラッキング MapTracker: Tracking with Strided Memory Fusion for Consistent Vector HD Mapping (Chen+, ECCV24)
abemii
0
220
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
170
Terraform CI/CD パイプラインにおける AWS CodeCommit の代替手段
hiyanger
1
240
【Startup CTO of the Year 2024 / Audience Award】アセンド取締役CTO 丹羽健
niwatakeru
0
990
Security-JAWS【第35回】勉強会クラウドにおけるマルウェアやコンテンツ改ざんへの対策
4su_para
0
180
Featured
See All Featured
A Philosophy of Restraint
colly
203
16k
Speed Design
sergeychernyshev
24
610
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Building an army of robots
kneath
302
43k
Practical Orchestrator
shlominoach
186
10k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
How GitHub (no longer) Works
holman
310
140k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
The World Runs on Bad Software
bkeepers
PRO
65
11k
BBQ
matthewcrist
85
9.3k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
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
6 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
7 • • • ▪ ▪ ▪ ▪ 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…
8 • • • • • • • • •
• Deep-dive in async/await bei Backend-APIs
9 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
10 • • • • • • • • •
Deep-dive in async/await bei Backend-APIs ALU & FPU Registers 0 Registers 1 Classic CPU Core CPU Core with Hyper-Threading
11 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
12 Deep-dive in async/await bei Backend-APIs
13 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
14 • • • • • 🤯 Deep-dive in async/await
bei Backend-APIs
15 Deep-dive in async/await bei Backend-APIs
16 ▪ ▪ ▪ ▪ ▪ ▪ ⏳ ▪ ▪
▪ Deep-dive in async/await bei Backend-APIs ReadFile API: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-readfile
17 ▪ ▪ ▪ ▪ ▪ ▪ ⏳ ▪ Deep-dive
in async/await bei Backend-APIs ReadFile API: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-readfile
18 Deep-dive in async/await bei Backend-APIs
19 • • async Task<> MyMethodAsync() • • • await
OtherMethodAsync() • • await • • • • Deep-dive in async/await bei Backend-APIs
20 Deep-dive in async/await bei Backend-APIs
21 Deep-dive in async/await bei Backend-APIs
22 • • task.GetAwaiter().GetResult() → ❌ • Thread.Sleep() → ❌
• await Task.Delay() → ✔ • Thread.SpinWait() • → ❌ • → ✔ Deep-dive in async/await bei Backend-APIs
23 • • var task1 = DoSomethingAsync(); var task2 =
DoSomethingElseAsync(); await Task.WhenAll(task1, task2); • • • Task.Factory.StartNew(…, TaskCreationOptions.LongRunning); • • • Deep-dive in async/await bei Backend-APIs
24 • • • • Deep-dive in async/await bei Backend-APIs
25 Deep-dive in async/await bei Backend-APIs
26 ▪ ▪ ▪ ▪ ▪ ▪ Deep-dive in async/await
bei Backend-APIs
27 ▪ ▪ ▪ ▪ ▪ 😉 Deep-dive in async/await
bei Backend-APIs
None