首页 > 试题广场 >

如下两个并发执行的进程A B,是否能够正确执行?若不能,请举

[问答题]
如下两个并发执行的进程A B,是否能够正确执行?若不能,请举例说明并改正之。注意:其中标号(1只(2)、(3)、(4)、 (5X (6)、 (7(8人仅为方便程序分析给出,并非程序代码。
Parbegin
Varx; integer;
ProcessA                                            ProcessB
Var y,zj integer;                                     Var t, u: integer;
Begin                                                   Begin
(1) X:=1; K                                          (5) X:=0;
(2)  y:=0;                                             (6) t:=0;
(3) ifx>=1 theny:=y+1;                         (7)  ifx<=1 thent:=t+2;
(4) z:=y;                                              (8) u:=t;
End                                                     End
Parend

a
发表于 2020-05-11 08:42:57 回复(0)