Skip to content

A Java-based simulator demonstrating core Inter-Process Communication (IPC) techniques—Message Queues, Pipes, and Shared Memory—using multithreading and synchronization. Ideal for learning OS concepts through hands-on simulation.

License

Notifications You must be signed in to change notification settings

Magnus0969/IPC-Simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

🖧 IPC Mechanism Simulator

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.


🔧 Features

  • 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

📁 Project Structure

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

🚀 Getting Started

✅ Requirements

  • Java 8 or higher
  • Java IDE (IntelliJ / Eclipse / VS Code) or terminal

▶️ Run the Project

  1. Clone the repository
git clone https://github.com/Magnus0969/IPC-Simulator.git
cd IPC-Simulator
  1. Compile the Java files
javac -d out src/ipc/*.java
  1. Run the simulation
java -cp out ipc.Main

🧠 IPC Mechanisms Simulated

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.


💻 Sample Output

[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

🎓 Use Cases

  • 📘 Operating System assignments and labs
  • 🔄 Understanding IPC and concurrency in Java
  • 🛠️ System design & process synchronization demos

🛠️ Future Enhancements

  • 🖥 JavaFX/Swing-based visual dashboard
  • 📄 JSON-configurable process and communication patterns
  • 📡 Add semaphores, sockets, and advanced IPC
  • 🕒 Logging to file + timestamps

👨‍💻 Author

Karthik B Magadi
GitHub: @Magnus0969


📜 License

This project is licensed under the MIT License


Star this repo if you found it helpful!

About

A Java-based simulator demonstrating core Inter-Process Communication (IPC) techniques—Message Queues, Pipes, and Shared Memory—using multithreading and synchronization. Ideal for learning OS concepts through hands-on simulation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages