occam-pi:扩展交会点

发布于 2024-09-01 22:09:26 字数 34 浏览 2 评论 0原文

如果有人能向我解释延长交会的概念,我将不胜感激。谢谢。

I'd appreciate it if someone could explain the concept of extended rendezvous to me. Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

留蓝 2024-09-08 22:09:26

扩展交会允许您在收到通道通信后但在让其他进程继续之前执行操作。


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)
:

Extended rendezvous allows you to perform an action after having received a channel communication, but before letting the other process continue.


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)
:
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文