Package java.util.concurrent

Examples of java.util.concurrent.ThreadPoolExecutor.submit()


     // Split each store file.
    for (StoreFile sf: hstoreFilesToSplit) {
      //splitStoreFile(sf, splitdir);
      StoreFileSplitter sfs = new StoreFileSplitter(sf, splitdir);
      futures.add(threadPool.submit(sfs));
    }
    // Shutdown the pool
    threadPool.shutdown();

    // Wait for all the tasks to finish
View Full Code Here


      }
    }
   
    for(int i = 0 ; i < grad.length ; i++) {
      Runnable r = new GradRunnable(kernel, i);
      futures.add(threadPool.submit(r));
    }
   
    //wait for all jobs
    while(!futures.isEmpty())
    {
View Full Code Here

          public void run() {
            doLines(matrix, from, to);
          }
        };
       
        futures.add(threadPool.submit(r));
      }

      //wait for all jobs
      while(!futures.isEmpty())
      {
View Full Code Here

          public void run() {
            doBlock(min, max, vector);
          }
        };
       
        futures.add(threadPool.submit(r));
      }

      //wait for all jobs
      while(!futures.isEmpty())
        futures.remove().get();
View Full Code Here

    ThreadPoolExecutor exec = ThreadPoolServer.getThreadPoolExecutor();
    List<Future<Object>> futures = new ArrayList<Future<Object>>();
   
    for(int jj = 0 ; jj < A.length ; jj++) {
      final int j = jj;
      futures.add(exec.submit(new Callable<Object>() {

        @Override
        public Object call() {
          for(int i = 0 ; i < A[0].length ; i++) {
              out[i][j] = A[j][i];
View Full Code Here

    List<Future<Object>> futures = new ArrayList<Future<Object>>();
    final double[][] m = A;
   
    for(int ii = 0 ; ii < A.length ; ii++) {
      final int i = ii;
      futures.add(exec.submit(new Callable<Object>() {
        double tmp;
        @Override
        public Object call() {
          for(int j = i+1 ; j < m[0].length; j++) {
            tmp = m[i][j];
View Full Code Here

    ThreadPoolExecutor exec = ThreadPoolServer.getThreadPoolExecutor();
    List<Future<Object>> futures = new ArrayList<Future<Object>>();
   
    for(int ii = 0 ; ii < m ; ii++) {
      final int i = ii;
      futures.add(exec.submit(new Callable<Object>() {

        @Override
        public Object call() throws Exception {
          for(int j = 0 ; j < n ; j++) {
            double sum = 0;
View Full Code Here

    ThreadPoolExecutor exec = ThreadPoolServer.getThreadPoolExecutor();
    List<Future<Object>> futures = new ArrayList<Future<Object>>();
   
    for(int ii = 0 ; ii < m ; ii++) {
      final int i = ii;
      futures.add(exec.submit(new Callable<Object>() {

        @Override
        public Object call() throws Exception {
          for(int j = 0 ; j < n ; j++) {
            double sum = 0;
View Full Code Here

    ThreadPoolExecutor exec = ThreadPoolServer.getThreadPoolExecutor();
    List<Future<Object>> futures = new ArrayList<Future<Object>>();
   
    for(int ii = 0 ; ii < m ; ii++) {
      final int i = ii;
      futures.add(exec.submit(new Callable<Object>() {

        @Override
        public Object call() throws Exception {
          for(int j = 0 ; j < n ; j++) {
            double sum = 0;
View Full Code Here

    ThreadPoolExecutor exec = ThreadPoolServer.getThreadPoolExecutor();
    List<Future<Object>> futures = new ArrayList<Future<Object>>();
   
    for(int ii = 0 ; ii < m ; ii++) {
      final int i = ii;
      futures.add(exec.submit(new Callable<Object>() {

        @Override
        public Object call() throws Exception {
          for(int j = 0 ; j < n ; j++) {
            double sum = 0;
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.