Simulation network of processors in java
I must do one more simulation in Java.
A part of this simulation is allocation new processes in processors dependents of algorithm.
I think about below logic conception:
In my simulation is many objects of Processor.
Queue<Process> queue; // processes come up in concrete moment
//(when process.getTime() == time, where time is increments per cycle )
Set<Process> running; // running processes on the processor
Set<Process> waiting; // store processes, which can't add to running, because load on processor > 100%
// decrease timeToLife every processes in running
// if process.timeToLife == 0 then the process is delete from running
// while(!waiting.isEmpty && this.overload + p.load (p from waiting) < 100)
// move p from waiting to running
// p = fetch process from queue (if process.getTime() in queue == time)
// The algorithm should randomize other processor pOther (max. k times)
// and send there process p if (pOther.load < threshold) to processor pOther(migration) , else add to this processor
// HELP ME HERE with communicate with another processors involve to migration process
// if process will run on this processor (above migration is not succeed) and this.overload + process.overload > 100%
// then process --> waiting, else process --> running
I don't know how effectively deliver communication between processors. I want implement this and another(similar) algorithms in class Processor, and I want to avoid looping reference (class a-> b and b->a)
My English isn't too good, so sorry and thank you for reading this topic.
Small introduction to the problem is here: http://www.scribd.com/doc/24745318/D...tems-Tanenbaum (page from 197)
Re: Simulation network of processors in java
Don't these distributed systems generally have a host controller than manages to some extent the communication between nodes? Or does this system need to be totally decentralized?