Jerry Feldman wrote:
I suggest you get Dave Butenhof's book, "Programming with POSIX Threads". This is an excellent book and Dave certainly knows his stuff since he was one of the primary threads developers for both VMS and Tru64_Unix.
Thanks, I'll check that out. I've got plenty of experience with multi-threaded programming, mutexes, spinlocking, atomic exchanges and all that jazz, except specifically in the POSIX model.
If you can avoid using fork(2) in a threaded application, then do so.
I would if I could.
If you need to use fork(2), just try to be aware that in the child, the only thread that will exist in the child process is the thread that actually performed the fork(2).
Yep, I understand that too. I execve() very quickly anyway - I only the usual stuff of getpid(), couple of dup2()s and such. Does anyone have a list of the async-signal-safe library functions that can be called safely between the fork() and the exec()? The only list I've found on the 'net seems to come from a Solaris man page. /Per Jessen, Zürich