Project assignment for Computer Networks course. Webserver written in C that satisfies HTTP GET requests. Webserver is implemented in three different ways: single-threaded, multi-threaded, and thread-pooled
- Waits for client request
- Processes the request
- Repeats this cycle. All of these steps are executed in a single thread
- Waits for client request
- When it accepts a new client connection, creates a new thread, and waits for other clients
- The new thread processes the new request
Web server creates threads very frequently, so it can consume lots of computing resources to create new threads. To solve this problem, thread-pooled server creates the threads in advance, wakes a thread and gives task to the thread whenever it is needed. https://en.wikipedia.org/wiki/Thread_pool
Download files, use make to compile servers. To run execute ./server. To connect to the server, send the requests with browser to your local IP and port 5000, like http://IP:5000