Is it possible to connect two running applications using pipelines, similar to how Perl uses them?
Otherwise, how else could I implement a seperate UI program?
Is it possible to connect two running applications using pipelines, similar to how Perl uses them?
Otherwise, how else could I implement a seperate UI program?
There are several forms of inter-process communication (IPC) available in C++. Pipes are one option.
Note that separate processes isn't always the best solution, you might also want to consider just using separate threads in the same process.
How could I use seperate threads?
The program would be halted whist waiting for input from the user, but at the same time, the program needs to monitor other stuff.
Thats what threads do. One thread waits for user input while another does work in the background. You can have several threads if you have several different things to do, and there doesn't necessarily have to be one for UI.
To use them you will probably want to do some research on how they work. Which thread API you use depends on your platform, although Boost's thread library might be a good choice regardless.
Thanks Daved. Do you have any links to online tutorials, or something? I've tried a google search for some of the terms that you've written, but with no results.
Actually I don't, sorry. You would go to boost.org to get the latest boost download if you want to use their threads library. They would have documentation there as well. I don't know of any good threads tutorials though. Perhaps someone else will be able to chime in on the subject. What OS and compiler/IDE are you using?
If you are using linux, there's a good tutorial about thread in YoLinux. Also you can google for POSIX thread.
For windows, look at this tutorial. You might also have to learn about thread synchronization.
ERROR: Brain not found. Please insert a new brain!
“Do nothing which is of no use.” - Miyamoto Musashi.
I'm using Borland CPP running on Windows XP.
I originally wanted to have two processes (comand line applications) running parallel to each other, with one used for monitoring, and the other as user interface, where messages can be sent to the UI by the monitor and commands can be sent by the UI to the monitor.
I might now use two Windows (just simple text "terminals") running on different threads, to give the appearance of two processes.
At the moment though, IPC seems to be the best solution, but I can't find any document on that either. A simple google search for 'C++ pipeline' returns nothing at all.
Try C++ IPC or C++ pipes, not pipeline.
if you do decide to use boost.threads (and I'd recommend them), there's a good tutorial on the subject here. It's pretty basic, but it should get you started.
"I saw a sign that said 'Drink Canada Dry', so I started"
-- Brendan Behan
Free Compiler: Visual C++ 2005 Express
If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?