Книга: Distributed operating systems

9.4.4. Kernel Calls for Communication

9.4.4. Kernel Calls for Communication

The port management calls are shown in Fig. 9-17. The first four are straightforward, allowing ports to be created, destroyed, enabled, and disabled. The last one specifies a port and a process. After the call completes, the port no longer belongs to its original owner (which need not be the caller) but instead belongs to the target process. It alone can now read messages from the port.

Call Description
portCreate Create a port and return its capability
portDelete Destroy a port
portEnable Enable a port so its messages count on a receive from all ports
portDisable Disable a port
portMigrate Move a port to a different process

Fig. 9-17. Selected port management calls.

Three calls are present for managing port groups. They are listed in Fig. 9-18. The first, grpAllocate, creates a new port group and returns a capability for it to the caller. Using this capability, the caller or any other process that subsequently acquires the capability can add or delete ports from the group.

Call Description
grpAllocate Create a port group
grpPortInsert Add a new port to an existing port group
grpPortRemove Delete a port from a port group

Fig. 9-18. Calls relating to port groups.

Our last group of kernel calls handles the actual sending and receiving of messages. These are listed in Fig. 9-19. IpcSend sends a message asynchronously to a specified port or port group. IpcReceive blocks until a message arrives from a specified port. This message may have been sent directly to the port, to a port group of which the specified port is a member, or to all enabled ports (assuming that the specified port is enabled). An address into which the fixed part is to be copied must be supplied, but an address for the body is optional, because the size is not always known in advance. If no buffer is provided for the body the ipcGetData call can be executed to acquire the body from the kernel (the size is now known since it is returned by the IpcReceive call). A reply message can be sent using ipcReply. Finally, ipcCall performs a remote procedure call.

Call Description
ipcSend Send a message asynchronously
ipcReceive Block until a message arrives
ipcGetData Get the current message's body
ipcReply Send a reply to the current message
ipcCall Perform a remote procedure call

Fig. 9-19. Selected communication calls.

Оглавление книги

Генерация: 1.049. Запросов К БД/Cache: 3 / 1
Вверх Вниз