Skip to content

Commit 7a03a96

Browse files
committed
add asyncPreempt monodraw
1 parent 6535074 commit 7a03a96

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

1.14/signal_based_preemption.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ asyncPreempt 是汇编实现的,分为三个部分:
285285
2. 执行 asyncPreempt2
286286
3. 恢复 g 的所有寄存器,继续执行用户代码
287287

288-
289288
```
290289
┌────────────────┐ ┌────────────────┐
291290
│ stack change │ │ code │
@@ -300,13 +299,13 @@ asyncPreempt 是汇编实现的,分为三个部分:
300299
│ ├──────────────┴───────────┐ │ │ └────────────────────────┴────────────────────────┘ │
301300
│ │ local var 1 │ │ │ │
302301
│ ├──────────────────────────┤ │ │ ┌──────────────────────────┐ │
303-
│ │ local var 2 │ │ │ │ │ │ │
302+
│ │ local var 2 │ │ │ │ │ signal handler │ │
304303
│ ├──────────────────────────┤ │ │ │ │ │ │
305-
│ ┌─────┐ │ ... │ │ │ │ │ signal handler │ │
304+
│ ┌─────┐ │ ... │ │ │ │ │ push 0x21350 to stk top │ │
306305
│ │ RSP │ ─────────────▶ └──────────────────────────┘ │ │ │ │ │ │
307-
│ └─────┘ │ │ │ │ push 0x21350 to stk top │ │
308-
│ │ │ │ │ │ │
306+
│ └─────┘ │ │ │ │ set pc to asyncPreempt │ │
309307
│ │ │ │ │ │ │
308+
│ │ │ │ │ return │ │
310309
│ │ │ │ └──────────────────────────┘ │
311310
│ │ │ ▼ │
312311
│ ┌──────────────┐ │ │ │
@@ -344,7 +343,7 @@ asyncPreempt 是汇编实现的,分为三个部分:
344343
│ │ RSP │ ─────────────▶ └──────────────────────────┘ │ │ │ │
345344
│ └─────┘ │ │ ▼ │
346345
│ │ │ ┌───────────────────────┐ │
347-
│ │ │ │ asyncPreempt() │ │
346+
│ │ │ │ asyncPreempt2() │ │
348347
│ │ │ └───────────────────────┘ │
349348
│ │ │ │
350349
│ ┌──────────────┐ │ │ │ │

monodraw/asyncPreempt.monopic

5.81 KB
Binary file not shown.

0 commit comments

Comments
 (0)