This project implements a high-performance, multi-threaded C server for computing the SHA-256 hash of files.
The server is designed to handle multiple clients concurrently, using a robust architecture based on FIFO communication and Pthreads for task parallelization.
The goal is to deliver an efficient and scalable service by optimizing resource usage through:
- Caching system
- Intelligent request scheduling (Shortest-Job-First)
- Strict concurrency control
Make sure the following dependencies are installed:
build-essential(formakeandgcc)cmakelibssl-dev(for OpenSSL)
sudo apt update
sudo apt install build-essential cmake libssl-dev
# 1. Create a build directory
mkdir build
# 2. Enter the build directory
cd build
# 3. Configure the project
cmake ..
# 4. Compile the project
make
After successful compilation, the executables will be available in the bin/ directory.
Execution
All commands should be executed from the project’s root directory.
1. Run the Server
Open a terminal and start the server:
./bin/server
2. Run the Client
Open a second terminal and run the client, specifying the filename:
./bin/client test1KB.txt
Running Tests
The project includes several test scripts (.sh) located in the root directory.
Before running them, make them executable:
chmod +x ./*.sh
Then, you can execute the test scripts normally:
./test_script.sh