libexecstream Icon

libexecstream

beta
4.7 Stars (3)
12 Downloads (This Week)
Last Update:
Download libexecstream-0.3.tar.gz
Browse All Files
Windows BSD Linux

Description

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

libexecstream Web Site

Categories

System

License

BSD License

KEEP ME UPDATED

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
Write a Review

User Reviews

  • 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5

    Better than Boost.Process, and very easy to learn.

    Posted 07/05/2015
  • 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5

    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.

    Posted 08/08/2014
  • 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5

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

    Posted 08/20/2010
Read more reviews

Additional Project Details

Intended Audience

Developers

Programming Language

C++

Registered

2004-03-04

Thanks for helping keep SourceForge clean.

Screenshot instructions:
Windows
Mac
Red Hat Linux   Ubuntu

Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies
X

Briefly describe the problem (required):

Upload screenshot of ad (required):
Select a file, or drag & drop file here.

Please provide the ad click URL, if possible:

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks