minix消息传递中rendezvous概念

消息传递的实际功能以一对原语的形式提供:
send (destination, message) 
receive (source, message) 
消息传递优点:  它有助于在分布式系统以及共享存储器的多处理器系统和单处理器系统中的实现。
 
当发送进程调用执行send原语时,有两种处理方式:
1、发送者进程被阻塞,直到这个消息被接收到为止。
2、发送者进程不阻塞,继续执行。
当接收进程调用执行receive原语时,有两种处理方式:
1、如果消息在执行receive原语之前发送,则该消息能被接收。
2、如果receive原语没有接收到消息,则选择下列一种方式执行:
      ①该进程被阻塞直到一个消息到达
      ②该进程放弃接收,继续执行
 
发送者和接受者按阻塞和非阻塞有三种不同的组合:
1、Blocking send, blocking receive
    (进程间紧密同步时,采用阻塞发送和阻塞接收)
Both sender and receiver are blocked until message is delivered(发送者和接受者都被阻塞,直到完成信息的传送)
Called a rendezvous(称为会合)
2、Nonblocking send, nonblocking receive
Neither party is required to wait(不需要任何一方等待续)
3、Nonblocking send, blocking receive
(最常用的一种方法:非阻塞发送,阻塞接收)
Sender may continue on,Receiver is blocked until the requested message arrives.  (发送者继续执行,接收者被阻塞直到请求的消息到达)
 It allows a process to send one or more messages  to  a variety of destinations   as quickly as possible.(允许进程发送一个或多个消息尽快的给各种目标进程)
例如,一个服务进程给其它进程提供服务或资源.
采用此种方式存在的问题:
①由于无阻塞发送:当收不到应答,会引起多次重发
②由于阻塞接收,当收不到消息时,会引起死等.

 
 
 
 
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章