IPC Vs RPC — Ways for program/service to communicate
Hey guys, here is a smallie blog to share my understanding of IPC and RPC from what I gathered by reading site to site, so minifying it for…
IPC Vs RPC — Ways for program/service to communicate
Hey guys, here is a smallie blog to share my understanding of IPC and RPC from what I gathered by reading site to site, so minifying it for you guys. Hope when you’re finished reading you’ll be thanking me
> Inter-process communication
Let’s consider processes p1 & p2, e.g. in an ATM machine there are different processes, one that reads your pin(p1) and another fetches your current balance(p2). Each process has a different memory block and also they need a way to interact to maintain the consistency, coordination and safety.
IPC does this(sharing memory and coordination between processes) using two approaches, implemented by opearating system :
- Shared memory
- Message passing
Shared memory
A memory segment is shared between the processes to either deliver or extract the information from another process via this shared memory allocated by kernel.

- The implementation is done by the programmer.
- It uses synchronisation mechanism(semaphores to avoid conflicts between simultaneously occuring read/write operations between multiple processes.
- For example a google doc where multiple people can edit at the same time.
Message sharing
In message sharing communication between processes takes place via kernel, making the system calls(send(), recv()) at each step. These processes don’t share memory directly.

- Safer than the shared memory because there’s no risk of overwriting the shared data.
- It adds an overhead due to kernel involvement.
Limitations in IPC:
- It has high risk of improper synchronisation in case of multiple processes sharing same resource, leads to deadlock, race condition or starvation.
- Managing many processes can cause scalability issue.
- It brings security concerns and overhead due to kernel involvement.
Examples of IPC are — Dining Philosophers Problem, Producer–Consumer Problem, Readers–Writers Problem and Sleeping Barber Problem.
> Remote Procedure Call
RPC lets your app call a function on another computer through the network as if it were a normal local function(running on the same computer/device as your program). RPC hides details and complexity of networking.

Working of a RPC
- Client Calls Stub: The client calls a local procedure (stub) as if it were normal.
- Marshalling: The stub packs (marshals) all input parameters into a message.
- Send to Server: The message is sent across the network to the server.
- Server Stub: The server stub unpacks the message and calls the actual server procedure.
- Execution & Return: The server runs the procedure and returns the result to the stub.
- Back to Client: The server stub sends the result back, and the client stub unpacks it.
Type of RPC
- Callback RPC
- Broadcast RPC
- Batch-mode RPC
Advantages of RPC
- Makes distributed communication easier.
- Hides low-level networking complexity.
- Developers can work with function calls instead of manually handling sockets and packets.
- Helpful in microservices and distributed systems.
Disadvantages of RPC:
- Slower than local function calls because network is involved.
- Dependent on network/server availability.
- Debugging distributed systems can be difficult.
- Tight coupling between client and server can happen.
- Different systems/languages may face compatibility issues.
So in simple words, IPC helps processes communicate inside a system, while RPC helps systems communicate across networks. Different use cases, same goal — communication.
메타데이터
- post_id
- 1cf08cbaf0cf
- slug
- ipc-vs-rpc-ways-for-program-service-to-communicate-1cf08cbaf0cf
- url
- https://medium.com/@shalinibhatt9608/ipc-vs-rpc-ways-for-program-service-to-communicate-1cf08cbaf0cf
- canonical_url
- https://medium.com/@shalinibhatt9608/ipc-vs-rpc-ways-for-program-service-to-communicate-1cf08cbaf0cf
- author_url
- https://medium.com/@shalinibhatt9608
- status
- ok
- fetched_at
- 2026-06-11 21:11:36