Examples of AtomicInteger


Examples of java.util.concurrent.atomic.AtomicInteger

       
        CHUNKSZ = (Fact[n] + NCHUNKS - 1) / NCHUNKS;
  NTASKS = (Fact[n] + CHUNKSZ - 1) / CHUNKSZ;
        maxFlips = new int[NTASKS];
        chkSums  = new int[NTASKS];
        taskId = new AtomicInteger(0);

        int nthreads = Runtime.getRuntime().availableProcessors();
        Thread[] threads = new Thread[nthreads];
        for ( int i=0; i<nthreads; ++i ) {
            threads[i] = new Thread( new fannkuchredux() );
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicInteger

            final SoftReference reference = get();
            return reference == null ? null : (ThreadCategoryInfo) reference.get();
        }

        public AtomicInteger getUsage (String name) {
            AtomicInteger u = usage.get(name);
            if (u != null) {
                return u;
            }

            final AtomicInteger ai = new AtomicInteger();
            final AtomicInteger prev = usage.putIfAbsent(name, ai);
            return prev == null ? ai : prev;
        }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicInteger

    if (restore)
      OwlUI.getFeedViews();
  }

  private boolean shouldRunInBackground(List<IEntity> entities, List<INews> newsToDelete) {
    AtomicInteger newsCount = new AtomicInteger();
    newsCount.addAndGet(newsToDelete.size());

    for (IEntity entity : entities)
      countNewsWithLimit(entity, newsCount, RUN_IN_BACKGROUND_CAP);

    return newsCount.get() > RUN_IN_BACKGROUND_CAP;
  }
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.