C++ library that allows you to run an external program and have its input,
output and error available as standard C++ streams.

Project Activity

See All Activity >

Categories

System

License

BSD License

Follow libexecstream

libexecstream Web Site

Other Useful Business Software
$300 Free Credits for Your Google Cloud Projects Icon
$300 Free Credits for Your Google Cloud Projects

Start building on Google Cloud with $300 in free credits. No commitment, no credit card required until you're ready to scale.

Launch your next project with $300 in free Google Cloud credits—no strings attached. Test, build, and deploy without risk. Use your credits across the entire Google Cloud platform to find what works best for your needs. After your credits are used, continue with always-free tier services. Only pay when you're ready to scale. Sign up in minutes and start exploring.
Start Free Trial
Rate This Project
Login To Rate This Project

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

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" ); } } }
Read more reviews >

Additional Project Details

Operating Systems

BSD, Linux, Windows

Intended Audience

Developers

Programming Language

C++

Related Categories

C++ System Software

Registered

2004-03-04