Fibonacci using Fork()
I have an assignment of writing a C program using fork()(using process and not thread) that generates the Fibonacci sequence in the child process and then have the parent process to print out the sequence. I'll have to make the processes share memory (mutual exclusion issue) in addition to making the parent process wait for the child process to finish (synchronization issue).
Also I'll have to write two versions for the Fibonacci program: one to demonstrate a race condition between two processes and the other to show two processes communicating via a shared memory safe-guarded by a semaphore.
But I don't know how to do that. Can anyone please help me out with this?