Ok so here is my problem, i have to write a simple computr system consisting of the processor and the memory,

The project will simulate a simple computer system consisting of a CPU and Memory.
The CPU and Memory will be simulated by separate processes that communicate
I have to use unix fork to create child processes and a pipe so that both the memory and processor can communicate

My idea is to start of with 2 classes the processor class and the memory class , but am not sure how the forking will work. The pipe i have some idea but its also a bit blurry , hence i never used this two before. I also have the choice of usign java and runtime but i want to try on c++ to get more experience.

RTFM. Use fork()/exec() functions to create a child process, which will then communicate with the parent process via pipes or TCP/IP connections.

In any case, start by modeling how the processor and memory will work/interact. Until you determine that behavior, anything else is a waste of time. FWIW, I taught a bunch of grade-school children how to build a stack machine (processor and memory) back in 1985, just like you are tasked with now. If they can handle it, you can too!

This question has already been answered. Start a new discussion instead.