A Java-based simulation of classic Inter-Process Communication (IPC) mechanisms — Pipes, Shared Memory, and Message Queues. This project demonstrates how processes communicate in an OS-like environment using Java multithreading and synchronization.
- Simulates 3 IPC mechanisms:
- 🧵 Pipe Communication
- 🧠 Shared Memory
- 📬 Message Queue
- Thread-safe communication between processes
- Modular and extensible design
- Real-time event logging
- Educational and demonstrative use case
IPC-Simulator/
├── src/
│ └── ipc/
│ ├── Logger.java // Logs inter-process events
│ ├── MessageQueue.java // Message queue simulation
│ ├── PipeCommunication.java // Pipe-based communication
│ ├── SharedMemory.java // Shared memory simulation
│ ├── ProcessSimulator.java // Simulates concurrent processes
│ └── Main.java // Entry point to run simulation
├── README.md
- Java 8 or higher
- Java IDE (IntelliJ / Eclipse / VS Code) or terminal
- Clone the repository
git clone https://github.com/Magnus0969/IPC-Simulator.git
cd IPC-Simulator- Compile the Java files
javac -d out src/ipc/*.java- Run the simulation
java -cp out ipc.Main| Mechanism | Description |
|---|---|
| Pipes | Uses PipedInputStream and PipedOutputStream to simulate stream-based IPC. |
| Shared Memory | Simulates shared access to a memory block via synchronized Map. |
| Message Queue | Implements FIFO-based communication using BlockingQueue. |
Each method is encapsulated in its own class and orchestrated via ProcessSimulator.
[Logger] Process A wrote to Pipe: Hello [Logger] Process B read from Pipe: Hello [Logger] Process A wrote to Shared Memory: [key: 1, value: Data] [Logger] Process B read from Shared Memory: Data [Logger] Process A sent message: Ping [Logger] Process B received message: Ping
- 📘 Operating System assignments and labs
- 🔄 Understanding IPC and concurrency in Java
- 🛠️ System design & process synchronization demos
- 🖥 JavaFX/Swing-based visual dashboard
- 📄 JSON-configurable process and communication patterns
- 📡 Add semaphores, sockets, and advanced IPC
- 🕒 Logging to file + timestamps
Karthik B Magadi
GitHub: @Magnus0969
This project is licensed under the MIT License
⭐ Star this repo if you found it helpful!