I have made an OS simulator for a project, for the next part I have to modify the simulator to include 4 CPUs in place of only 1 CPU from the previous part, so that all the processes get done in a faster time.
So I have to add concurrency but I am not sure what the right design pattern is for this kind of thing. I need to know if the following will actually give me a speed up.
CPU extends Thread
//in main
get process1
get process 2
get process 3
get process 4
cpu1.run(process1)
cpu2.run(process2)
cpu3.run(process3)
cpu4.run(process4)
am I right in assuming that because cpus are extending thread they will all run concurrently for finish the 4 processes or will it be just like running the 4 processes on a single CPU?