occam-pi:扩展的集合点

时间:2010-05-19 03:33:49

标签: occam-pi

如果有人能向我解释扩展会合的概念,我会很感激。感谢。

1 个答案:

答案 0 :(得分: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)
: