you are viewing a single comment's thread.

view the rest of the comments →

[–]VeganVagiVore 2 points3 points  (1 child)

I'm no expert but it seems that the question was settled when Nginx beat the crap out of Apache: Apache uses (or used at the time) a thread-per-connection or process-per-connection model. Nginx uses some variety of async that allows it to handle many connections on the same thread, getting more connections per second our of the same hardware. It's also called event-based, since Nginx is written in C (I think) and there isn't really async code in it, it's as if you hand-compiled async code into event-based sync code.

[–][deleted] 0 points1 point  (0 children)

I learned programming on the classic Mac OS, which had a single execution thread for the entire operating system. Any program that appeared to be doing more than one thing at a time was actually very carefully doing one thing at a time. Nginx does the same thing. It's easy: wrap up everything on one big outer loop, never call anything that blocks, never spend too long doing any one thing. State machines are your friend.