Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.Rendezvous


      assertEquals("abc", client.invoke("abc"));
      log.info("connection is good");
     
      int THREADS = 20;
      int LOOPS = 1000;
      Rendezvous barrier = new Rendezvous(THREADS * 2 + 1);
      CreateCallbackThread[] createCallbackThreads = new CreateCallbackThread[THREADS];
      InvokerLocatorUpdateThread[] invokerLocatorUpdateThreads = new InvokerLocatorUpdateThread[THREADS];
      for (int i = 0; i < THREADS; i++)
      {
         createCallbackThreads[i] = new CreateCallbackThread(i, client, barrier, LOOPS);
         invokerLocatorUpdateThreads[i] = new InvokerLocatorUpdateThread(i, barrier, LOOPS * 100);
         createCallbackThreads[i].start();
         invokerLocatorUpdateThreads[i].start();
      }
      log.info("main thread going to rendezvous");
      barrier.rendezvous(null);
      barrier.rendezvous(null);
      log.info("main thread leaving second rendezvous");
     
      client.disconnect();
      shutdownServer();
     
View Full Code Here


      assertEquals("abc", client.invoke("abc"));
      log.info("connection is good");
     
      int THREADS = 20;
      int LOOPS = 1000;
      Rendezvous barrier = new Rendezvous(THREADS * 2 + 1);
      CreateCallbackThread[] createCallbackThreads = new CreateCallbackThread[THREADS];
      InvokerLocatorUpdateThread[] invokerLocatorUpdateThreads = new InvokerLocatorUpdateThread[THREADS];
      for (int i = 0; i < THREADS; i++)
      {
         createCallbackThreads[i] = new CreateCallbackThread(i, client, barrier, LOOPS);
         invokerLocatorUpdateThreads[i] = new InvokerLocatorUpdateThread(i, barrier, LOOPS * 100);
         createCallbackThreads[i].start();
         invokerLocatorUpdateThreads[i].start();
      }
      log.info("main thread going to rendezvous");
      barrier.rendezvous(null);
      barrier.rendezvous(null);
      log.info("main thread leaving second rendezvous");
     
      client.disconnect();
      shutdownServer();
     
View Full Code Here

/* 1706 */       if (nthreads < parties) parties = nthreads;
/* 1707 */       if (nthreads % parties != 0)
/* 1708 */         throw new Error("need even multiple of parties");
/* 1709 */       exchangers_ = new Rendezvous[nthreads / parties];
/* 1710 */       for (int i = 0; i < exchangers_.length; i++)
/* 1711 */         exchangers_[i] = new Rendezvous(parties);
/*      */     }
/*      */   }
View Full Code Here

/*      */     }
/* 1741 */     return this.exchanger_;
/*      */   }
/*      */
/*      */   public void exchange() throws InterruptedException {
/* 1745 */     Rendezvous ex = getExchanger();
/* 1746 */     Runnable r = (Runnable)ex.rendezvous(new UpdateCommand(this));
/* 1747 */     if (r != null) r.run();
/*      */   }
View Full Code Here

      // Test datatype race.
      MicroRemoteClientInvoker clientInvoker = (MicroRemoteClientInvoker) client.getInvoker();
     
      int THREADS = 1000;
      TestThread[] threads = new TestThread[THREADS];
      Rendezvous startBarrier = new Rendezvous(THREADS);
      Rendezvous stopBarrier = new Rendezvous(THREADS + 1);
     
      log.info(getName() + " creating " + THREADS + " threads");
      for (int i = 0; i < THREADS; i++)
      {
         threads[i] = new TestThread(clientInvoker, startBarrier, stopBarrier, i);
View Full Code Here

      assertEquals("abc", client.invoke("abc"));
      log.info("connection is good");
     
      int THREADS = 20;
      int LOOPS = 1000;
      Rendezvous barrier = new Rendezvous(THREADS * 2 + 1);
      CreateCallbackThread[] createCallbackThreads = new CreateCallbackThread[THREADS];
      InvokerLocatorUpdateThread[] invokerLocatorUpdateThreads = new InvokerLocatorUpdateThread[THREADS];
      for (int i = 0; i < THREADS; i++)
      {
         createCallbackThreads[i] = new CreateCallbackThread(i, client, barrier, LOOPS);
         invokerLocatorUpdateThreads[i] = new InvokerLocatorUpdateThread(i, barrier, LOOPS * 100);
         createCallbackThreads[i].start();
         invokerLocatorUpdateThreads[i].start();
      }
      log.info("main thread going to rendezvous");
      barrier.rendezvous(null);
      barrier.rendezvous(null);
      log.info("main thread leaving second rendezvous");
     
      client.disconnect();
      shutdownServer();
     
View Full Code Here

TOP

Related Classes of EDU.oswego.cs.dl.util.concurrent.Rendezvous

Copyright © 2018 www.massapicom. 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.