4 ms·
useless insanity! you can do same in the shell and with every PL worth using. Seriously folks...
by mahmud 15y ago
useless insanity! you can do same in the shell and with every PL worth using.
Seriously folks...
- nakkiel 15y agoWell, in the real world people tend not to fork from within a webserver.
- mahmud 15y agoin the real world, forgetting "var" doesn't bring down web servers.
- SaltwaterC 15y agoIn the real world people use node.js for other stuff that web servers. Like background processing that involves a lot of I/O, therefore the bias against spawning a shell has no ground.
- fexl 15y agoI have noticed a popular aversion to "fork", and I don't quite understand it. It uses the "copy on write" technique, and it seems very fast in my benchmarks. For example, I have a benchmark where I can spawn 1000 or more processes right from the command line, all banging away on shared files with locking, and it all seems very fast and stable, every time. I don't even bother with pre-forking. But I do make heavy use of "Keep-Alive", with appropriate guards against abuse under heavy load. I'm a big fan of the simplicity of fork and blocking I/O, but I'm sure other people have different requirements and constraints they might want to share here.
- SaltwaterC 15y agoSpawning a new process is not the same thing as forking, but people often forget this bit. This post wasn't about forking.
- fexl 15y agoI thought that spawning a new process was the same as forking. What am I missing?
- SaltwaterC 15y agohttp://linux.die.net/man/2/fork http://linux.die.net/man/2/fork - this explains better.
- fexl 15y agoThanks, but I already know what fork does. My point is that "fork" is precisely how one spawns a new process, and there is no other way to do so.