2

誰かが私に拡張ランデブーの概念を説明してくれたら幸いです。ありがとう。

4

1 に答える 1

2

拡張ランデブーを使用すると、チャネル通信を受信した後、他のプロセスを続行する前にアクションを実行できます。


PROC a(CHAN INT sendtoB, sendtoC):
  SEQ
    -- do some stuff
    ...
    -- communicate with B, this will not complete 
    -- until the extended rendezvous completes
    sendtoB ! 123
    -- do some other stuff before sending info to another process
    ...
    sendtoC ! 345
:

PROC b(CHAN INT receivefromA):
  INT tmp:
  SEQ
    --do some stuff
    receivefromA ?? tmp
      -- do some stuff before process C gets data from process a
      ...
    -- release the channel and do some other stuff
    ...
:    

PROC c(CHAN INT receivefromA):
  INT tmp:
  SEQ
    -- This will wait until proc b releases
    receivefromA ? tmp
    -- this will only run after the first communication from A to B completes.

PROC run(CHAN BYTE kyb, scr, err):
  CHAN INT AtoB, AtoC:
  PAR
    a(AtoB, AtoC)
    b(AtoB)
    c(AtoC)
:
于 2010-06-01T17:06:32.820 に答える