...In the end this turned out to be a "classical" example of "YAGNI"...
If we just accept, that STDERR will be intermingled with STDOUT (which is ugly, but not really a problem for the kind of tests we want to perform), then there is a much simpler solution, which most of the time works as reliable as the elaborate solution based on non-blocking I/O - redirect STDERR into STDIN already in in the setup after fork() but prior to calling execve() to start Yoshimi - use a reader Thread just to read lines with blocking I/O - between each Line, check for tasks from the main thread - the main thread hands those tasks over, connected with a future - main thread can then block on this future with timeout - in case of timeout, just kill the child process With my last commit, we can now launch a Yoshimi and feed the "exit force" into the CLI to make it terminate immediately, to demonstrate this setup. -- Hermann _______________________________________________ Yoshimi-devel mailing list Yoshimi-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/yoshimi-devel