首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >occam-pi:扩展会合

occam-pi:扩展会合
EN

Stack Overflow用户
提问于 2010-05-19 11:33:49
回答 1查看 327关注 0票数 2

如果有人能给我解释一下延长约会的概念,我将不胜感激。谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-06-02 01:06:33

Extended rendezvous允许您在接收到通道通信之后,但在允许其他进程继续之前执行操作。

代码语言:javascript
复制
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)
:
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2862675

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档