News for hackers. Stuff that matters.
Re:Fork() without exec() is dangerous in large programs by evanj on Wednesday August 17, 2016 @08:00AM (#12303994)
Thanks for pointing this out! Interesting that the code states that part of the concern is increasing memory usage. I don't quite understand why it would "duplicate the memory usage" since fork uses copy-on-write?

Anyway, I didn't explain it well, but this was what I was trying to get at with "fork a worker at the beginning of your program, before there can be other threads."

Re:Fork() without exec() is dangerous in large programs by the_why_of_y on Wednesday August 17, 2016 @08:53AM (#12304235)
Copy-on-write doesn't work the same on every OS... Linux uses over-commit so it's not a big deal, but Solaris (and NT) don't over-commit so you actually need enough VM at the time when you call fork or fork will fail, so you may need to provide a lot of swap space on those systems to successfully call fork in large processes.
Re:Fork() without exec() is dangerous in large programs by evanj on Wednesday August 17, 2016 @09:23AM (#12304445)
Ah thanks, that makes sense. Fun trade-offs: Either run out of memory when you call fork, or fight with the out-of-memory killer at a later time :)