News for hackers. Stuff that matters.
Re:Fork() without exec() is dangerous in large programs (2016) by btilly on Tuesday June 14, 2022 @09:44PM (#31748198)
The classic pattern was that you'd spin up something like Apache, load it full of read-only data, then start forking its children. Hoping that you'd share memory between children.

With what you describe, you'd share nothing because at the point you've loaded it up, all the data you just loaded is resident. :-(

Re:Fork() without exec() is dangerous in large programs (2016) by cryptonector on Tuesday June 14, 2022 @10:27PM (#31748449)
If loading == mmap(2)ing read-only, then it's not a problem. Read-only pages don't get CoW'ed.
Re:Fork() without exec() is dangerous in large programs (2016) by btilly on Tuesday June 14, 2022 @11:03PM (#31748660)
Back when I did this, loading usually meant querying a bunch of constant data in mod_perl.
Re:Fork() without exec() is dangerous in large programs (2016) by cryptonector on Wednesday June 15, 2022 @01:23AM (#31749409)
So write the query results to files and then mmap() them!
Re:Fork() without exec() is dangerous in large programs (2016) by btilly on Wednesday June 15, 2022 @08:39PM (#31761245)
You'd be amazed at how difficult it is to make useful use of mmap() from within a variety of common scripting languages.