LWN.net Logo

Fun with file descriptors

Fun with file descriptors

Posted Jun 14, 2007 7:51 UTC (Thu) by slamb (guest, #1070)
In reply to: Fun with file descriptors by felixfix
Parent article: Fun with file descriptors

I'm not sure about a "no-no", but exec*() is generally preceded by fork(), and I'm told a fork() in large threaded programs can be extremely slow. Apache uses an external forking server for this reason. Other caveats include that in the fork()ed child process, it is as if all other threads suddenly died, and they still hold whatever mutexes they were holding. So any resources the child requires (before calling exec*()) need a pthread_atfork(3) handler or similar.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds