Results 1 to 2 of 2
  1. #1
    w0st is offline Member
    Join Date
    May 2012
    Posts
    1
    Rep Power
    0

    Default 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:

    Java Code:
    class 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%
            int time;
            int load;
    
    
            cycle()
           {
                 // 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
    
                time++;
           }
    
    }
    In my simulation is many objects of Processor.
    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)
    Last edited by w0st; 05-09-2012 at 03:18 AM.

  2. #2
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default 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?

Similar Threads

  1. Water Fluid Simulation for Java
    By CuppaCoffee in forum New To Java
    Replies: 0
    Last Post: 04-05-2012, 06:14 AM
  2. PeerSim P2P simulation based on JAVA
    By aditya149149 in forum Threads and Synchronization
    Replies: 0
    Last Post: 08-25-2011, 12:16 AM
  3. Simulation of a Network architecture
    By m4enigma in forum Advanced Java
    Replies: 0
    Last Post: 04-04-2011, 05:55 PM
  4. Simulation in Java
    By Eranga in forum Advanced Java
    Replies: 15
    Last Post: 08-15-2010, 05:32 AM
  5. Small tennis simulation in Java
    By diego in forum New To Java
    Replies: 1
    Last Post: 12-02-2007, 02:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •