I am trying to channel data via pipes whenever a signal arrives from a thread to the main process.
Is this possible?
How can this be done?
As others have said, this may be more trouble than it is worth.
However, if you insist.
Probably easiest just to open two pipes using popen
and rw
mode before spawning the thread. Choose one for main-->thread and the other for main<--thread and just go ahead.
Or you could open a total of four file descriptors after spawning, as if they were two different processes