Is it possible to execute a shell command by creating a thread i.e. without using popen/system or any of the fork-exec variants? Why or why not?
To provide more context,
Here's an useful summary on the multi-threading & fork+exec potential problems: http://www.linuxprogrammingblog.com/threads-and-fork-think-twice-before-using-them
It seems that if you want to execute other programs and even shell scripts, you have to use fork+exec, it's unavoidable. Just be careful and prepare your threads for such a "bad" event like fork. Also you could close all unnecessary file descriptors in a special single threaded trusted execute helper being run from the main application, if that's the problem.