Hacker News new | past | comments | ask | show | jobs | submit login

Then you run a GC and dirty all your pages.



Yeah; forking is cheaper for low memory programs with no moving GC.


GC usually runs on a separate thread right? Isn't it true you shouldn't run fork() when you have a multithreaded program?


Not usually. Only an advanced GC will be concurrent. Something like Perl or Ruby for example runs in the foreground. If it is concurrent then you shut down the GC thread, fork, and then start a new thread in each new process.


It's probably not safe to fork() from most frameworks threads (OpenMP) and is hard to make safe for complicated parallel processing. But if you control the flow of execution and minimize mutex and critical section(s) it can be done withal. Several examples of thread served queues performing user defined actions upon message receipt to include fork() + exec() come to mind.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: