News for hackers. Stuff that matters.
Re:Computing file hashes with node.js by nakkiel on Tuesday November 01, 2011 @08:44AM (#3181703)
Well, in the real world people tend not to fork from within a webserver.
Re:Computing file hashes with node.js by fexl on Tuesday November 01, 2011 @10:24AM (#3182145)
I 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.
Re:Computing file hashes with node.js by SaltwaterC on Tuesday November 01, 2011 @11:20AM (#3182454)
Spawning a new process is not the same thing as forking, but people often forget this bit. This post wasn't about forking.
Re:Computing file hashes with node.js by fexl on Tuesday November 01, 2011 @11:55AM (#3182634)
I thought that spawning a new process was the same as forking. What am I missing?
Re:Computing file hashes with node.js by SaltwaterC on Tuesday November 01, 2011 @02:03PM (#3183280)
http://linux.die.net/man/2/fork - this explains better.
Re:Computing file hashes with node.js by fexl on Tuesday November 01, 2011 @02:13PM (#3183325)
Thanks, 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.
Re:Computing file hashes with node.js by mahmud on Tuesday November 01, 2011 @08:50AM (#3181728)
in the real world, forgetting "var" doesn't bring down web servers.
Re:Computing file hashes with node.js by SaltwaterC on Tuesday November 01, 2011 @09:40AM (#3181918)
In 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.