2 ms·
That's probably why there are so many, and so many terrible options out there. It's relatively simple to write a trivial web server in C. To make a fast and us
by rbanffy 3y ago
That's probably why there are so many, and so many terrible options out there.
It's relatively simple to write a trivial web server in C. To make a fast and usable web server in C is most likely anything but trivial.
You'll need:
- a way to register URL patterns and assign handler functions to them.
- a way to set shared mutable process-wide things such as connections to external services and make sure one thread doesn't trample on - or needlessly block - other thread's changes.
- a transparent way to make handlers work inside a single thread using asynchronous IO functions wherever possible. Fair enough - we are no longer in the trivial web server anymore.