Python program is doing a front end-work and C program is doing a back-end work. Each of them is a separate process.
Python process acts as a master process which sends signals and events to the C process.
The C process generates stats, counters and information which is sent back to the python process which displays it to the user.
There will be a duplex communication between them
After searching for different techniques, I found these are some of the ways I could do it:
1. Create a UDP/TCP socket between the 2 processes.
2. Use a memory mapped file.
What should be the format of the data passed?
1. Should I use variable size structures?
2. Should I use Tag Length Value Format?
3. Should I use XML?
Can I have a common file which both the process understand?
For example, a common header file which has the format of the data to passed.
Different kinds of data messages are
1. Signal messages from python to c.
2. Signal messages from c to python.
3. Heartbeat messages from python to c.
4. Stats messages from c to python.
5. Log messages from c to python.
6. Progress messages from c to python.
7. Update messages from python to c
In terms of C, each message is C structure.