Skip to content

πŸ’»πŸ’‰ Projects for the course of System Programming. Gained knowledge on multithreading, inter process communication (named pipes), low-level I/O and network communication (Server-Client model).

Notifications You must be signed in to change notification settings

mansstiv/System-Programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

50 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

System-Programming Projects

Part1 - diseaseMonitor

Purpose of this project is to implement a program, which based on an input file with patient records, can answer different questions about disease cases.

Tests knowledge on data structures and time complexity.

Input

A patientRecordsFile with patient records entries. A record could look like 889 Mary Smith COVID-2019 China 25-1-2019 27-1-2019.

Structures

  1. Hash Tables
  2. Linked lists
  3. Red Black Trees

Why these structures?

Due to the big amount of patient records entries, hash tables and red black trees can secure a small time complexity on performing specific queries.

How to run..

There is a makefile that responds to the following commands:

  1. make -> compile the program and produce the corresponding object files and executable.

  2. make clean -> deletes the object files and executable that were created.

./diseaseMonitor -p patientRecordsFile -h1 diseaseHashtableNumOfEntries -h2 countryHashtableNumOfEntries -b bucketSize

NOTE : bucketSize must be >= 24

  • For example run: ./diseaseMonitor -p small.txt -h1 10 -h2 10 -b 100

Commands

  • /globalDiseaseStats [date1 date2]

    • Print for each virus, the number of cases recorded in the system. If date1 date2 are given, print for each virus, the number of cases recorded within the time period [date1 ... date2].
  • /diseaseFrequency virusName [country] date1 date2

    • If no country argument is given, print for virusName disease, the number of cases cases recorded during time period [date1 ... date2].
    • If country argument is given, print for virusName disease, the number of cases in country recorded during time period [date1 ... date2].
  • /topk-Diseases k country [date1 date2]

    • Print for the country given, top k diseases with most cases recorded during time period [date1 ... date2].
  • /topk-Countries k disease [date1 date2]

    • For the disease given, print top k countries with the most cases in time period [date1 ... date2]. .
  • /insertPatientRecord recordID patientFirstName patientLastName diseaseID entryDate [exitDate]

    • Insert a new patient record, with the characteristics given (exitDate parameter is optional).
  • /recordPatientExit recordID exitDate

    • Add exit date to patient record with recordID id.
  • /numCurrentPatients [disease]

    • If disease argument is given, print the number of patients, who are still being treated with this disease. If no argument is given, do the same, but for every disease.
  • /exit

    • Exit program.

Part2 - diseaseAggregator

Purpose of diseaseAggregator is similar as it were in Part 1. However this time instead of one process, we have multiple processes communicating with named pipes, that work together to answer the questions given.

Gained knowledge on low level I/O (fork/exec, read, write etc..) and on inter process communication.

Commands and running remains the same. Input files can be found in input_dir directory, which is created by a bash script.

Part3 - serverClient

Purpose of this project is similar as it were in Part 2. However this time except multiple processes communicating with named-pipes, a multithreading client-server model is also implemented.

Gained knowledge on thread programming, socket programming and on network communication (Client-Server model).

About

πŸ’»πŸ’‰ Projects for the course of System Programming. Gained knowledge on multithreading, inter process communication (named pipes), low-level I/O and network communication (Server-Client model).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published