Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parent Child process in C++

Status
Not open for further replies.

gong

Vendor
Feb 26, 2003
1
US
Hi,
I would like to generate a child process which reads in data from a hardware and conducts a data smoothing algorithm. The averaged variable will be "sent" to the parent process if the parent process "calls" for the variable.
As the parent process is running at a rate slower than that of the child process, in the event where the child process reaches the end of the loop and the parent process has yet to call for the variable, the child process will proceed with the next loop.
The parent process thus calls for and recieves the most current value of the averaged variable from the child process. The parent process is itself a loop.
Any suggestions as to how the process can be written in C++ is greatly appreciated.
Thank you.
 
If this is going to run on a Windows platform, you can share data between processes using the CreateFileMapping and MapViewOfFile API calls. Two processes can synchronize using a named mutex.
Let me know if you need more information or a sample.

Marcel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top