Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 36 for newFixedThreadPool (0.23 sec)

  1. guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java

        ExecutorService executor = newFixedThreadPool(1);
        requestInterruptIn(500);
        executor.execute(new SleepTask(10000));
        executor.shutdown();
        assertFalse(awaitTerminationUninterruptibly(executor, 1000, MILLISECONDS));
        assertFalse(executor.isTerminated());
        assertInterrupted();
      }
    
      public void testTryAwaitTerminationInfiniteTimeout() {
        ExecutorService executor = newFixedThreadPool(1);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 31.7K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/util/concurrent/ListenerCallQueueTest.java

      }
    
      public void testEnqueueAndDispatch_multithreaded() throws InterruptedException {
        Object listener = new Object();
        ExecutorService service = Executors.newFixedThreadPool(4);
        ListenerCallQueue<Object> queue = new ListenerCallQueue<>();
        try {
          queue.addListener(listener, service);
    
          final CountDownLatch latch = new CountDownLatch(1);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 8.2K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/util/concurrent/ListenerCallQueueTest.java

      }
    
      public void testEnqueueAndDispatch_multithreaded() throws InterruptedException {
        Object listener = new Object();
        ExecutorService service = Executors.newFixedThreadPool(4);
        ListenerCallQueue<Object> queue = new ListenerCallQueue<>();
        try {
          queue.addListener(listener, service);
    
          final CountDownLatch latch = new CountDownLatch(1);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 8.2K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java

              }
              throw new SampleRuntimeException();
            }
          };
    
      private TimeLimiter service;
    
      private static final ExecutorService executor = Executors.newFixedThreadPool(1);
    
      @Override
      protected void setUp() throws Exception {
        super.setUp();
        service = SimpleTimeLimiter.create(executor);
      }
    
      public void testNewProxy_goodMethodWithEnoughTime() throws Exception {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 9.5K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java

    import static com.google.common.util.concurrent.Uninterruptibles.tryAcquireUninterruptibly;
    import static com.google.common.util.concurrent.Uninterruptibles.tryLockUninterruptibly;
    import static java.util.concurrent.Executors.newFixedThreadPool;
    import static java.util.concurrent.TimeUnit.MILLISECONDS;
    import static java.util.concurrent.TimeUnit.SECONDS;
    
    import com.google.common.base.Preconditions;
    import com.google.common.base.Stopwatch;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 30.9K bytes
    - Viewed (0)
  6. samples/crawler/src/main/java/okhttp3/sample/Crawler.java

      public Crawler(OkHttpClient client) {
        this.client = client;
      }
    
      private void parallelDrainQueue(int threadCount) {
        ExecutorService executor = Executors.newFixedThreadPool(threadCount);
        for (int i = 0; i < threadCount; i++) {
          executor.execute(() -> {
            try {
              drainQueue();
            } catch (Exception e) {
              e.printStackTrace();
            }
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 4.6K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/util/concurrent/AtomicLongMapBasherTest.java

        final int getsPerTask = 1000;
        final int deltaRange = 10000;
        final String key = "key";
    
        final AtomicLongMap<String> map = AtomicLongMap.create();
    
        ExecutorService threadPool = Executors.newFixedThreadPool(nThreads);
        ArrayList<Future<Long>> futures = new ArrayList<>();
        for (int i = 0; i < nTasks; i++) {
          futures.add(
              threadPool.submit(
                  new Callable<Long>() {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  8. guava-testlib/test/com/google/common/testing/FakeTickerTest.java

      @GwtIncompatible // concurrency
      private void runConcurrentTest(int numberOfThreads, final Callable<@Nullable Void> callable)
          throws Exception {
        ExecutorService executorService = Executors.newFixedThreadPool(numberOfThreads);
        final CountDownLatch startLatch = new CountDownLatch(numberOfThreads);
        final CountDownLatch doneLatch = new CountDownLatch(numberOfThreads);
        for (int i = numberOfThreads; i > 0; i--) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Feb 06 14:40:46 GMT 2024
    - 6.3K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/util/concurrent/TrustedListenableFutureTaskTest.java

      }
    
      @J2ktIncompatible
      @GwtIncompatible // blocking wait
      public void testRunIdempotency() throws Exception {
        final int numThreads = 10;
        final ExecutorService executor = Executors.newFixedThreadPool(numThreads);
        for (int i = 0; i < 1000; i++) {
          final AtomicInteger counter = new AtomicInteger();
          final TrustedListenableFutureTask<Integer> task =
              TrustedListenableFutureTask.create(
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 7.3K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapBasherTest.java

        final int getsPerTask = 1000;
        final int deltaRange = 10000;
        final String key = "key";
    
        final AtomicLongMap<String> map = AtomicLongMap.create();
    
        ExecutorService threadPool = Executors.newFixedThreadPool(nThreads);
        ArrayList<Future<Long>> futures = new ArrayList<>();
        for (int i = 0; i < nTasks; i++) {
          futures.add(
              threadPool.submit(
                  new Callable<Long>() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 4.2K bytes
    - Viewed (0)
Back to top