Relative Content

Tag Archive for c++cmultiprocessing

How to send data to children processes from parent process using queue?

I am trying to process a queue of files by spawning multiple processes. I want to spawn two children processes in order to traverse a queue of files. As soon as the process of one file ends, the process should pick the next file in the queue and this should go on till the queue is empty.
I know that the memory is copied from parent process for a spawned child process and I am not able to maintain a single queue in order to keep a track of files processed.
Here’s my implementation: