Hello,
I'm planning to using a 128x64 LCD display, I want to show some data from other programs.
I was thinking to run this task in the background with some different screens.
For example:
Screen 1:
CPU load, memory usage, disk usage, network usage.
Since this is general information, this is polled py the "lcd program" itself.
... After a while ...
Screen2:
Information from program A
... and so on, multiple programs ...
This cycles between the screens with the most recent data sent, some programs run every 5 minutes for example.
Now the question, how to feed the data in the program?
I've searched some information about named pipes, but most information is for daemons and couldn't find a good example for my purpose.
Is this the best way or other suggestions? I want to keep it as simple as possible for the clients to put data in (something like value1;10)
-
- Posts: 75
- Joined: Thu Mar 15, 2012 7:27 pm
Re: Sending data between seperate programs
You could use shared memory, pipes, sockets, or files. What's best (if there is a best) would depend on the details of what you are trying to achieve and how it's expected to grow. I'd probably start with pipes.
Re: Sending data between seperate programs
A named pipe is probably the easiest way to do inter process communication, although, it does have its drawbacks. Use the Unix/Linux command to create a FIFO file, mkfifo <filename> or as an example mkfifo /tmp/myfifo. After that you can write to /tmp/myfifo (if that's the name used when you created the fifo) from one process, then read from /tmp/myfifo from the other process.
Re: Sending data between seperate programs
Simply create a file in /dev/shm and mmap() it into all your processes, you will be responsible for locking and arbitrating access to the file 
