正在加载图片...
Example:Teeter-Totter left right while(true){ 50 50 cli; timer: if([right]=0){ if([1eft]==0){ sti; print("right wins!"); break; iret; } [right]:=[right]-1; [left] :=[1eft]-1; [1eft]:=[1eft]+1; [right][right]+1; sti; iret; print("left wins!"); How to guarantee non-interference?Example: Teeter-Totter while(true){ cli; if([right] == 0){ sti; break; } [right] := [right]-1; [left] := [left]+1; sti; } print(“left wins!”); timer: if([left] == 0){ print(“right wins!”); iret; } [left] := [left]-1; [right] := [right]+1; iret; 50 50 left right How to guarantee non-interference?
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有