User Ratings

★★★★★
★★★★
★★★
★★
2
1
0
0
0
ease 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5 4 / 5
features 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5 4 / 5
design 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5 4 / 5
support 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5 3 / 5

Rate This Project
Login To Rate This Project

User Reviews

  • Better than Boost.Process, and very easy to learn.
  • libexecstream has worked well in a couple projects, but we did run into a problem when there were multiple threads started simultaneously and there was likely thread/process contention. Calls in exec-stream-impl.cpp and exec-stream-helpers.cpp to select(...) would occasionally be interrupted by an EINTR error. As far as we can tell, this does not represent an error condition. The select call is just waiting until the status descriptor has something to read, at which point it will return +1. Restarting the status descriptor with the same time delay will extend the possible timeout (or, possibly, on some systems, continue with the remaining time as previously requested). This solution seems to work for our applications. Specifically, around each call to select(), we replaced the if() with a while() loop to restart the select() call in the event of errno==EINTR. I've placed diffs of our files in the wiki, but sourceforge won't let me put a link to it here.
  • OK so this lib works as it's been used for years in a couple of our modules. But it's got a flaw. If you call the kill method the child process will be left as a defunct process (aka zombie) in the system. I sent an email to the author a few days ago, but got no reply. So I am just going to stick my fix here: void exec_stream_t::kill() { if( m_impl->m_child_pid!=-1 ) { if( ::kill( m_impl->m_child_pid, SIGKILL )==-1 ) { throw os_error_t( "exec_stream_t::kill: kill failed" ); } // The correct way to handle killing a child process is to wait for the OS // to release the child process resources before assigning -1 to m_child_pid. // Assigning -1 to m_child_pid without waiting will result in a "defunct" process // (aka zombie process) remaining in the process table. pid_t code=waitpid( m_impl->m_child_pid, &m_impl->m_exit_code, 0 ); if( code == m_impl->m_child_pid ) { m_impl->m_child_pid=-1; m_impl->m_exit_code=0; } else if( code == -1 ) { throw os_error_t( "exec_stream_t::kill: waitpid failed" ); } } }