java - correct concurrency pattern -


I have created an OS simulator for a project, in the next part I need to include the simulator 4 cpu in place Only 1 CPU from the part, so that all processes are done in a fast time.

So I have to add concurrency, but I am not sure what is the correct design pattern for such a thing. I have to know whether I will actually give a speed.

  The main mill proccess in CPU extended threads / 1 process 2 gets process 3 process process 4 CPU 1. Arn (Process 1) CPU 2 I'm assuming right because the CPU is expanding the thread, they will participate concurrently to complete all 4 processes or Will it be the same as running 4 processes on a CPU? 

By the nature of the question, this is a class project and your representation of the CPU is relatively simple. For example, just run a series of instructions like thread class. However, if you are trying to emulate real-world CPUs and microprocessors, then we need to know more about CPU specifications: scheduling, event handling and other low-level aspects that are usually hidden. .

But, in simple case, the answer is usually yes.

Note, based on the work in those processes and the CPU, which you run this code, you can see different behaviors because how CPUs and JVM are actually implementing threads. But, I think it's not relevant in your case.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -