This repository contains my implementation of a multithreaded incremental entropy algorithm, as proposed in the paper "Entropy-based scheduling performance in real-time multiprocessor systems" by Dr. Rincon. This project was developed as part of my Operating Systems course at the University of Houston.
The aim of this assignment is to create a multithreaded version of the incremental entropy algorithm. The program reads a series of strings representing task scheduling information of CPUs in a multiprocessor system and calculates the entropy at each scheduling instant using POSIX threads.
- Multithreading: Utilizes POSIX threads for concurrent entropy calculations.
- Dynamic Input: Reads scheduling information from STDIN.
- Efficient Entropy Calculation: Implements Dr. Rincon's incremental entropy algorithm.
To compile and run this project:
- Clone the repository:
git clone https://github.com/mustafaemresahin/multithreaded-entropy-calculation.git
- Navigate to the repository directory:
cd multithreaded-entropy-calculation
- Compile the program using g++:
g++ -pthread -o entropyCalculator main.cpp
- Run the program:
./entropyCalculator
Input the scheduling information when prompted.
The program expects input in the following format:
[Task] [Execution Time] [Task] [Execution Time] ...
For example:
A 2 B 4 C 3 A 7
The program outputs the entropy values for each CPU scheduling information provided. For example:
CPU 1
Task scheduling information: A(2), B(4), C(3), A(7)
Entropy for CPU 1
0.00 0.92 1.53 1.42
- g++ compiler with support for C++11 or later.
- POSIX threads library.
Special thanks to Dr. Rincon for the foundational algorithm and for their guidance and support.