KasperskyOS Community Edition 1.3

Creating IPC channels

IPC channels can be created statically or dynamically.

Statically created IPC channels

Static creation of IPC channel has the following characteristics:

  • Creation of an IPC channel is performed by the parent process that starts the client and server (this is normally Einit).
  • The client and server are not yet running when the IPC channel is created.
  • You cannot create a new IPC channel in place of a deleted one.

The IPC channels defined in the init description are statically created. You can also use the task.h API to statically create IPC channels.

To get the client and server IPC handles and the endpoint ID (RIID), use the sl_api.h API.

Dynamically created IPC channels

Dynamic creation of IPC channels lets you change the topology of interaction between processes on the fly. For example, this is necessary if it is unknown which specific server provides the endpoint required by the client.

Dynamic creation of IPC channel has the following characteristics:

  • The IPC channel is jointly created by the client and server.
  • The client and server are already running when the IPC channel is created.
  • You can create a new IPC channel in place of a deleted one.

To dynamically create IPC channels, use the DCM system program.

Aside from using the DCM system program, you can also dynamically create IPC channels by using the cm_api.h and ns_api.h APIs provided by the libkos library together with the NameServer system program. However, this latter method is obsolete and therefore not recommended.

If a dynamically created IPC channel is no longer required, its client and server handles can be closed. The IPC channel can be created again if necessary.