Skip to content

Commit 4ba39ad

Browse files
committed
docs: update README.md
1 parent 5e980de commit 4ba39ad

1 file changed

Lines changed: 7 additions & 32 deletions

File tree

README.md

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
44
![CI](https://github.com/brenlau9/c-multithreaded-http-server/actions/workflows/ci.yml/badge.svg)
55

6-
A lightweight, POSIX-threaded HTTP/1.1 server supporting concurrent GET and PUT requests.
7-
Built with a thread pool, a custom writer-priority reader–writer lock, and robust file I/O helpers.
6+
A multithreaded HTTP/1.1 server implemented in C, demonstrating systems programming, concurrency primitives, and low-level networking.
87

98
## 🚀 Features ##
109
### HTTP/1.1 GET ###
@@ -110,41 +109,17 @@ Each file name is associated with:
110109
Worker behavior:
111110
- GET → reader_lock(), read file, reader_unlock()
112111
- PUT → writer_lock(), write/overwrite, writer_unlock()
113-
### Writer-Priority Read–Write Lock ###
114-
Tracks:
115-
- active_readers
116-
- active_writers
117-
- waiting_readers
118-
- waiting_writers
119-
Rules:
120-
- A writer must wait until no readers or writers are active
121-
- If any writer is waiting, new readers must wait
122-
- Writer gets exclusive access
123-
- Readers may run concurrently when no writer is waiting
124-
125-
## 🧪 Manual Testing Examples ##
126-
### GET existing file ###
127-
```bash
128-
echo "hello" > a.txt
129-
curl http://127.0.0.1:8080/a.txt
130-
```
131-
PUT new file
132-
```bash
133-
curl -X PUT -H "Content-Length: 11" \
134-
--data-binary "new content" \
135-
http://127.0.0.1:8080/b.txt
136-
```
137-
Overwrite existing file
138-
```bash
139-
curl -X PUT -H "Content-Length: 3" \
140-
--data-binary "xyz" \
141-
http://127.0.0.1:8080/a.txt
142-
```
112+
### Writer-Priority Read–Write Lock
113+
- Ensures PUT operations get exclusive access.
114+
- Allows multiple concurrent GET requests when no writer is waiting.
115+
- Prevents writer starvation through explicit writer-priority logic.
143116

144117
## 🧭 Future Improvements ##
145118
- Add DELETE support
146119
- Improve modularity and reduce duplication
147120
- Expand test coverage for concurrency and edge cases
148121
- Add graceful shutdown for worker threads
149122

123+
## 📄 License
124+
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
150125

0 commit comments

Comments
 (0)