From 634bb00a9a4d07dccee6d13f8120793bd0bc55dc Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Fri, 31 May 2013 16:29:19 +0100 Subject: investigating using a processes rather than threads --- processmodel/processmodel.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 processmodel/processmodel.cpp (limited to 'processmodel/processmodel.cpp') diff --git a/processmodel/processmodel.cpp b/processmodel/processmodel.cpp new file mode 100644 index 0000000..ee75638 --- /dev/null +++ b/processmodel/processmodel.cpp @@ -0,0 +1,32 @@ +#include "Poco/Process.h" +#include "Poco/PipeStream.h" +#include "Poco/StreamCopier.h" +#include +#include +using Poco::Process; +using Poco::ProcessHandle; + +//1. make a basic executable that represents a render context +//get message passing going +//incorporate in REST server +//fill in the details + +int main(int argc, char** argv) +{ + std::string cmd("rendercontext"); + std::vector args; + args.push_back("-ax"); + Poco::Pipe outPipe; + Poco::Pipe inPipe; + ProcessHandle ph = Process::launch(cmd, args, &inPipe, &outPipe, 0); + Poco::PipeInputStream istr(outPipe); + Poco::PipeOutputStream ostr(inPipe); + //std::ofstream ostr("processes.txt"); + // + while (true){ + //Poco::StreamCopier::copyStream(istr,std::cout); + ostr<