News for hackers. Stuff that matters.
Re:Websocketd by sebazzz on Saturday January 26, 2019 @05:54AM (#19005772)
GC usually runs on a separate thread right? Isn't it true you shouldn't run fork() when you have a multithreaded program?
Re:Websocketd by chrisseaton on Saturday January 26, 2019 @06:08AM (#19005806)
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.
Re:Websocketd by romeisendcoming on Monday January 28, 2019 @12:21PM (#19019180)
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.