Interprocess communication and resource manager

Interprocess communication (IPC) is a feature of operating systems that allows two or more processes to interact and exchange data. In QNX, IPC is a fundamental component of the OS due to its microkernel architecture. Since many core services, such as device drivers and filesystems, run in user space, IPC plays a critical role in enabling communication between these services and the kernel. The primary form of IPC in QNX is synchronous message passing, implemented through the MsgSend(), MsgReceive(), and MsgReply() functions. This form of IPC is synchronous, meaning the sender is blocked until the receiver processes the message and replies. This design promotes deterministic behavior, simplifies debugging, and helps prevent common concurrency issues such as deadlocks.

This message passing model is also the foundation for QNX resource managers. A resource manager is a process that registers a pathname in the filesystem namespace and other processes can open that name using the standard C library open() function, then read() from and write() to the resulting file descriptor.  QNX resource managers serve a role similar to device drivers in other operating systems, such as Linux, but with a key difference; QNX resource managers run in user space like any other application, while Linux device drivers run in kernel space. An additional key point to note is that all communications between the client program and the resource manager are done through native IPC messaging. Even though resource manager API is used to build resource manager application, under the hood, the resource manager behaves like a server with a MsgReceive() loop, and clients interact with it using MsgSend(). You can find a basic implementation of a QNX resource manager in the "Single-threaded device resource manager" page of the Writing a Resource Manager guide.

If your project uses another method for IPC, you may want to consider migrating to QNX message passing and resource managers. To compare the trade-offs associated with the methods of IPC available on QNX, refer to the "Interprocess Communication (IPC)" chapter of the System Architecture guide.

Page updated: