{"id":26391302,"url":"https://github.com/kallistina/multi-threaded-file-server","last_synced_at":"2025-08-14T05:16:32.517Z","repository":{"id":266453515,"uuid":"898387766","full_name":"Kallistina/multi-threaded-file-server","owner":"Kallistina","description":"🖥️Multi-threaded file server for handling concurrent client requests using shared memory, semaphores, and pthreads.","archived":false,"fork":false,"pushed_at":"2024-12-04T10:34:24.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T10:19:11.547Z","etag":null,"topics":["file-server","multi-threading","parallel-processing","pthreads","semaphores","shared-memory"],"latest_commit_sha":null,"homepage":"https://eclass.uoa.gr/courses/D244/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kallistina.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-04T09:58:00.000Z","updated_at":"2024-12-04T14:04:42.000Z","dependencies_parsed_at":"2024-12-04T11:18:35.024Z","dependency_job_id":"152448a4-6ff3-47e9-b02a-07b4923db50d","html_url":"https://github.com/Kallistina/multi-threaded-file-server","commit_stats":null,"previous_names":["kallistina/multi-threaded-file-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kallistina/multi-threaded-file-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kallistina%2Fmulti-threaded-file-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kallistina%2Fmulti-threaded-file-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kallistina%2Fmulti-threaded-file-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kallistina%2Fmulti-threaded-file-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kallistina","download_url":"https://codeload.github.com/Kallistina/multi-threaded-file-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kallistina%2Fmulti-threaded-file-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270364971,"owners_count":24571423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-14T02:00:10.309Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["file-server","multi-threading","parallel-processing","pthreads","semaphores","shared-memory"],"created_at":"2025-03-17T10:19:14.395Z","updated_at":"2025-08-14T05:16:32.454Z","avatar_url":"https://github.com/Kallistina.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌐 **Multi-Threaded File Server** 🚀\n\nThis project is part of my university course Operating Systems (K22). The goal of this project was to implement a **multi-threaded file server** capable of handling **multiple client requests** simultaneously. The server and clients communicate using **shared memory**, **semaphores**, and **pthreads**, ensuring efficient file access and parallel processing.\n\n## 📝 **Project Overview**\n\nThe **Multi-Threaded File Server** is designed to handle multiple clients requesting specific lines from text files stored on the server. Each client makes multiple requests, and the server processes these requests concurrently using threads. The communication between the clients and the server is facilitated using:\n\n- **Shared memory** for data exchange.\n- **Semaphores** to synchronize the process and ensure data consistency.\n- **Pthreads** to handle multiple client requests in parallel.\n\n### 🖥️ **How It Works**\n1. The **server** creates multiple threads, each handling a specific client request.\n2. The **client** sends a request to the server for specific lines from a file stored in a directory.\n3. The **server** reads the requested lines and sends them back to the client via shared memory.\n4. The client and server communicate through semaphores, ensuring synchronization and proper handling of concurrent requests.\n\n---\n\n## 🧑‍💻 **How to Run**\n\n1. **Clone the Repository**:\n   ```bash\n   git clone https://github.com/your-username/multi-threaded-file-server.git\n   cd multi-threaded-file-server\n2. **Compile the Code**:\n\nThe project comes with a Makefile, so simply run:\n  ```bash\n  make\n  ```\n3. **Run the Server**:\n\nTo start the server, use the following command:\n\n  ```bash\n  ./fileServer \u003cnum_clients\u003e \u003cnum_requests\u003e \u003clambda\u003e\n  ```\n---\n\n## ⚙️ **Features**\n\n- **Multi-threading**: The server uses threads to process multiple client requests concurrently.\n- **Semaphore Synchronization**: Ensures correct timing and data access.\n- **Shared Memory**: Efficient communication between clients and the server.\n- **Configurable Parameters**: Set the number of clients, requests, and file parameters through command-line arguments.\n\n---\n\n## 📄 **File Structure**\n\n- `fileServer`: The main program for the server-side logic.\n- `headFile.h`: Contains headers and shared structures used for communication.\n- `my_functions.cpp`: Implements the server and client logic.\n- `Makefile`: Automates the compilation process.\n- `lines.txt`: Stores the results of each client's read operation.\n- `stats.txt`: Contains performance statistics and time delays for each client.\n\n---\n\n## 🔧 **Technologies Used**\n\n- **C++**: The programming language used for implementation.\n- **Pthreads**: For handling parallelism and multi-threading.\n- **Shared Memory**: For efficient data sharing between processes.\n- **Semaphores**: For process synchronization and control.\n- **Makefile**: For easy project compilation and management.\n\n---\n\n## 📈 **Project Purpose**\n\nThis project was developed to demonstrate concepts of parallelism, concurrent processing, and inter-process communication in a distributed environment. By simulating multiple clients making simultaneous requests to a file server, this project showcases how to handle synchronization, load distribution, and performance analysis.\n\n---\n\n## 🛠️ **Installation \u0026 Requirements**\n\n- Linux (Ubuntu or similar distribution recommended)\n- G++ (for compiling C++ code)\n- Make (for building the project)\n- POSIX Semaphores and Shared Memory (Linux-based IPC)\n\nMake sure to have the required libraries and tools installed:\n```bash\nsudo apt update\nsudo apt install build-essential\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkallistina%2Fmulti-threaded-file-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkallistina%2Fmulti-threaded-file-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkallistina%2Fmulti-threaded-file-server/lists"}