Examples of GlobalObject


Examples of aleph.GlobalObject

    this.total = INITIAL;
    this.used = 0;
   
    AbstractContext context = ContextDelegator.getInstance();
    if(context.getContextId()==null)
      new GlobalObject(this, ((AbstractDistinguishable)this).getId())// publish it now 
    else
      context.newObject(this)// add it to context publish-set
  }
View Full Code Here

Examples of aleph.GlobalObject

  public Customer(String id){
    this.id = id;
   
    AbstractContext context = ContextDelegator.getInstance();
    if(context.getContextId()==null)
      new GlobalObject(this, ((AbstractDistinguishable)this).getId())// publish it now 
    else
      context.newObject(this)// add it to context publish-set
  }
View Full Code Here

Examples of aleph.GlobalObject

    this.price = price;
    this.type = type;
   
    AbstractContext context = ContextDelegator.getInstance();
    if(context.getContextId()==null)
      new GlobalObject(this, ((AbstractDistinguishable)this).getId())// publish it now 
    else
      context.newObject(this)// add it to context publish-set
  }
View Full Code Here

Examples of aleph.GlobalObject

    this.id = id;
    this.value = value;

    AbstractContext context = ContextDelegator.getInstance();
    if(context.getContextId()==null)
      new GlobalObject(this, ((AbstractDistinguishable)this).getId())// publish it now 
    else
      context.newObject(this)// add it to context publish-set
  }
View Full Code Here

Examples of aleph.GlobalObject

  }

  @Override
  public void delete(AbstractDistinguishable deleted) {
    // no need for context delegator in DSM model
    GlobalObject key = ObjectsRegistery.getKey(deleted.getId());
    unregister(key);
    PE.thisPE().populate(new UnregisterObject(key))// unregister this object from other nodes
  }
View Full Code Here

Examples of aleph.GlobalObject

  count = Integer.parseInt(args[0]);
    } catch (NumberFormatException e) {
      Aleph.error("usage: Counter <#increments>");
      Aleph.exit(1);
    }
    GlobalObject global = new GlobalObject( new Counter() );
    UserThread   fork   = new UserThread(count, global);
    Join         join   = new Join();
    long start = System.currentTimeMillis();
    for (Iterator e = PE.allPEs(); e.hasNext(); ) {
      fork.start((PE) e.next(), join);
    }
    join.waitFor();
    Counter counter = (Counter) global.open("r");
    System.out.println(PE.numPEs() + " PEs, Final value is " + counter.value);
    System.out.println("Elapsed time: " +
           ((double) (System.currentTimeMillis() - start)) / 1000.0
           + " seconds");
  }
View Full Code Here

Examples of aleph.GlobalObject

  count = Integer.parseInt(args[0]);
    } catch (NumberFormatException e) {
      Aleph.error("usage: BigCounter <#increments>");
      Aleph.exit();
    }
    GlobalObject global = new GlobalObject( new BigCounter() );
    UserThread   fork   = new UserThread(count, global);
    Join         join   = new Join();
    long start = System.currentTimeMillis();
    for (Iterator e = PE.allPEs(); e.hasNext(); )
  fork.start((PE) e.next(), join);
    join.waitFor();
    BigCounter counter = (BigCounter) global.open("r");
    System.out.println("Final value is " + counter.value[0]);
    System.out.println("Elapsed time: " +
           ((double) (System.currentTimeMillis() - start)) / 1000.0
           + " seconds");
  }
View Full Code Here

Examples of aleph.GlobalObject

     if (r > 0) {
       System.out.println("Iteration " + r);
     }

     GlobalObject global = new GlobalObject( new Matrix(n) );
     UserThread   fork;
     Join         join   = new Join();

     long start = System.currentTimeMillis();

     // Start n*n threads to compute each entry of the result matrix

     Iterator e = PE.roundRobin();
     for (int i = 0; i < n; i++)
       for (int j = 0; j < n; j++) {
   fork = new UserThread(global, i, j, n);
   fork.start((PE)e.next(), join);
       }
     join.waitFor();
     // Print out the result
     Matrix matrix = (Matrix) global.open("r");
     System.out.println("The result matrix is: ");
     System.out.println(matrix);
     try { global.release(); } catch (AlephException x) {}
     System.out.println("Elapsed time: " +
      ((double) (System.currentTimeMillis() - start)) / 1000.0
      + " seconds");
     System.out.flush();
   }
View Full Code Here

Examples of aleph.GlobalObject

    }

    System.out.println("Test is : " + round + " round(s) of " + count + " incrementation(s)");
    System.out.flush();
   
    GlobalObject global = new GlobalObject( new GlobalObjectLatency() );
    UserThread   fork   = new UserThread(count, round, PE.numPEs(), global);
    Join         join   = new Join();
    long start = System.currentTimeMillis();
    for (Iterator e = PE.allPEs(); e.hasNext(); ) {
      fork.start((PE) e.next(), join);
    }
    join.waitFor();
    GlobalObjectLatency counter = (GlobalObjectLatency) global.open("r");
    System.out.println(PE.numPEs() + " PEs, Final value is " + counter.value);
    System.out.println("Elapsed time: " +
           ((double) (System.currentTimeMillis() - start)) / 1000.0
           + " seconds");
  }
View Full Code Here

Examples of aleph.GlobalObject

       
          for (AbstractDistinguishable obj: set.values()) {
            if(LockTable.checkLock( obj, clock, false)<0){
              AbstractDistinguishable object = (AbstractDistinguishable)obj;
              try {
                GlobalObject key = ObjectsRegistery.getKey(object.getId());
                if(key==null// deleted object
                  throw new TransactionException();
                Logger.debug("READSET: Remote Validation for " + key);
                try {
              CommunicationManager.getManager().send(key.getHome(), new ValidateRequest(key, hashCode));
            } catch (IOException e) {
              e.printStackTrace();
              throw new TransactionException();
            }
            Logger.debug("READSET: Wait Remote " + key + " Validation ...");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.