IPC Project - Multi-threading programming
- Remi Bettan

- 1 במאי 2016
- זמן קריאה 2 דקות
This project has been performed in teams of 3 programmers.
Each team received a description of the customer's requirements, from which we had to find the relevant details for the programming.
The project main subject was mobile operators and subscribers: the customer would send us files in which each line described an action of a subscriber, such as subscriber mobile id, SMS in/out, Call in/out and party operator and party subscriber.
We had to read these files from the Disk, parse each line in order to perform the data acquisition and to save the data in appropriate Data Structure. In parallel , the user should be able to get reports for the subscribers' actions and for the customer operator's total use (overall calls in/out overall SMS in/out).
After analyzing the customer's requirements description, each team started their High Level Design. We have used an UML tool (UMLet) to draw and discuss our design. The result of this design is shown in the below picture. The modules we had decided to implement were:
- Manager – module in which the Initialization of the System and its Termination would be performed.
- File Manager – module in which 1 thread would be created at the System initialization. This thread is responsible for detecting new files from the customer, mapping the file in a memory map, sending a pointer through a Queue to the beginning of the file to the Reader Module (see below).
- Reader – module in which 5 threads would be created at the System initialization. These threads are responsible for reading the files mapped by the File Manager, parsing the lines in order to perform the Data Acquisition and create new entries in the Data Structures or update existing entries. In the Reader module, the threads are only created and the parsing is performed. The work with the different Data Structures is done in the modules below.
- OpSub structures – this module conta0ined the relevant functions for the Operators' and Subscribers' structures work, while the main functions are the Insert and the Print functions.
- Data Manager – this module is the only one which is aware of which Data Structure is used and manages all the work with the Data Structures. The Data Structure which has been used is the HashMap: one for the Operators and one for the Subscribers.
- User Interface – module in which 1 thread would be created at the System initialization. This thread is responsible for getting the user's commands for a report request and for exiting the Program.
- Utilities Modules: HashMap (safe for multi-threading), Logger , Queue.
Then, we have divided the work on the different modules between the members of the team.
The integration between our works has been near to successful at the first time and only some minor bugs have been solved after it.


תגובות