This project was developed to explore and demonstrate the practical application of interprocess communication techniques under Linux. The objective was to showcase the use of shared memory, semaphores, message queues, and multi-processing to enable efficient and secure communication between multiple processes. By implementing these techniques, the project aimed to provide insights into the benefits and practicality of interprocess communication in various scenarios, such as distributed systems, parallel processing, and resource synchronization.
The project encompasses the following key features:
1- Shared Memory: Shared memory is used as a means of communication and data exchange between different processes. Processes can read from and write to a shared memory segment, enabling efficient and fast communication.
2- Semaphores: Semaphores are employed to synchronize access to shared resources. They allow processes to coordinate their actions, ensuring mutually exclusive access to critical sections of code or shared resources.
3- Message Queues: Message queues provide a structured way of exchanging messages between processes. Processes can send messages to a queue and other processes can retrieve and process those messages in a predefined order.
4- Multi-processing: The project utilizes multiple processes running concurrently to simulate a distributed system. Each process has a specific role and performs a set of tasks as part of the overall communication flow.
- Clone the repository to your local machine.
- In treminal:
1- Make sure you have the libfreetype6-dev library installed
sudo apt update
sudo apt install libfreetype6-dev
2- Then you can run the program using:
cd IPC-under-linux-Project2/source_code
make
./parent
- Monitor the output and check the generated files (spy.txt and receiver.txt) for the decoded messages
You can customize the following parameters in the source code:
- Number of helper processes
- Number of spy processes
- Thresholds for successful and failed decoding operations
Feel free to modify these parameters in inputVariables.txt to suit your specific needs.
(The maximum vlaue for variables is 40, which is the assumed maximum number of file columns, any greater values will be assumed 40)