Unless its a requirement I won't use fork in this situation...I would use threads..
gerard4143
Nearly a Posting Maven
2,272 posts since Jan 2008
Reputation Points: 512
Solved Threads: 387
H there, actually it is a requirement for this assignment....out of curiosity, how would you implement with threads...
If your having problems with fork() then threads should probably wait. One question, how are you coordinating the calculating and passing of data between the two processes(parent and forked child)..
gerard4143
Nearly a Posting Maven
2,272 posts since Jan 2008
Reputation Points: 512
Solved Threads: 387
Here's a simple fork/pipe example that passes data from the child to the parent.
Note you'll have to scroll down a few pages to find it:
http://www.daniweb.com/forums/thread258136.html
This simple example has most of the elements that you'll need..
gerard4143
Nearly a Posting Maven
2,272 posts since Jan 2008
Reputation Points: 512
Solved Threads: 387