Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-Threaded Web Server

A concurrent web server implemented in C .

Overview

Built a fully functional multi-threaded HTTP web server supporting concurrent client connections using a thread pool architecture.

Features

  • Fixed-size thread pool (producer-consumer pattern)
  • Bounded FIFO request queue with blocking synchronization
  • Reader-Writer synchronization with writer priority
  • GET and POST request handling
  • Server request logging system
  • Per-request and per-thread statistics collection
  • Debug mode with configurable sleep times

How It Works

  • Master thread accepts incoming connections and adds them to a queue
  • Worker threads pick requests from the queue and process them concurrently
  • GET requests write to the server log (exclusive access)
  • POST requests read the server log (concurrent access allowed)

Run

./server [port] [threads] [queue_size] [debug_sleep_time]

Example:

./server 5003 8 16 0

Tech

C · POSIX Threads · Mutex · Condition Variables · HTTP · Reader-Writer Locks

About

Concurrent HTTP server in C. Fixed-size thread pool, bounded FIFO queue, reader/writer sync with writer priority.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages