I would like to know why we prefer to make web servers multi-threaded
instead of make it multi-process web servers ....
Is it because of legacy issues.....
I would like to hear practical reasons as well as theoretical reasons
I would like to know why we prefer to make web servers multi-threaded
instead of make it multi-process web servers ....
Is it because of legacy issues.....
I would like to hear practical reasons as well as theoretical reasons
On *nix, to start up a process you need duplicate all the resources of the parent process. All the parents file descriptors are dup'ed, for example, and a new memory space is created to contain the new process. When the process terminates everything has to be torn down.
A thread, on the other hand, is essentially just a stack. Very quick to start and stop.
Early web servers didn't use threads for a simple reason: they weren't implemented yet.