-
Notifications
You must be signed in to change notification settings - Fork 0
Home
bedlamite edited this page Jul 1, 2023
·
16 revisions
Welcome to the guide wiki!
sequenceDiagram
participant t1 as 线程A
participant t2 as 线程B
participant i as static i
i ->> t2 : getstatic i 读取 0
t2 ->> t2 : iconst_1 准备常数 1
t2 ->> t2 : isub, 线程内 i = -1
t2 ->> t1 : 上下文切换(时间片用完)
i ->> t1 : getstatic i 读取 0
t1 ->> t1 : iconst_1 准备常数 1
t1 ->> t1 : isub, 线程内 i = 1
t1 ->> i : putstatic i 写入 1
t1 ->> t2 : 上下文切换(时间片用完)
t2 ->> i : putstatic i 写入 -1