首页 > 编程语言 >20230713 java.util.concurrent.ExecutorService

20230713 java.util.concurrent.ExecutorService

时间:2023-08-22 17:47:55浏览次数:43  
标签:java submit util concurrent Future ExecutorService

介绍

  • java.util.concurrent.ExecutorService
  • public interface ExecutorService extends Executor

API

  • shutdown

  • shutdownNow

  • isShutdown

  • isTerminated

  • awaitTermination

  • submit

    • Future<?> submit(Runnable task);
    • <T> Future<T> submit(Runnable task, T result);
    • <T> Future<T> submit(Callable<T> task);
  • invokeAll

  • invokeAny

标签:java,submit,util,concurrent,Future,ExecutorService
From: https://www.cnblogs.com/huangwenjie/p/17649201.html

相关文章

  • 20230713 java.util.concurrent.ScheduledExecutorService
    介绍java.util.concurrent.ScheduledExecutorServicepublicinterfaceScheduledExecutorServiceextendsExecutorServiceAPIschedulepublicScheduledFuture<?>schedule(Runnablecommand,longdelay,TimeUnitunit);public<V>ScheduledFuture<......
  • 20230713 java.util.concurrent.ThreadPoolExecutor
    介绍java.util.concurrent.ThreadPoolExecutorpublicclassThreadPoolExecutorextendsAbstractExecutorServiceAPI构造器ThreadPoolExecutor(intcorePoolSize,intmaximumPoolSize,longkeepAliveTime,TimeUnitunit,BlockingQueue<Runnable>workQueue)Thr......
  • 20230618 java.util.stream.BaseStream
    介绍java.util.stream.BaseStreampublicinterfaceBaseStream<T,SextendsBaseStream<T,S>>extendsAutoCloseableAPIiterator返回流的迭代器终结操作spliterator返回可拆分迭代器终结操作isParallel是否并行流sequential返回一个等效的串行流中......
  • 20230619 java.util.IntSummaryStatistics
    介绍java.util.IntSummaryStatisticspublicclassIntSummaryStatisticsimplementsIntConsumer统计的指标:count,sum,min,average,maxAPI构造器IntSummaryStatistics()IntSummaryStatistics(longcount,intmin,intmax,longsum)publiccombinevoidcombi......
  • 20230619 java.util.Optional
    介绍java.util.Optional类声明@jdk.internal.ValueBasedpublicfinalclassOptional<T>包装一个可能为null的值只有在正确使用的情况下才会更安全对应基本类型类:OptionalInt,OptionalLong,OptionalDoubleAPIstatic创建OptionalemptyofofNullablepublic......
  • 20230619 java.util.Random
    介绍java.util.RandompublicclassRandomimplementsRandomGenerator,java.io.SerializableAPI构造器Random()Random(longseed)seed:种子值,如果用相同的java.util.Random对象和相同的种子值来生成随机数,那么每次生成的随机数序列将是完全相同的publicsetSe......
  • 20230619 java.util.random.RandomGenerator
    介绍java.util.random.RandomGeneratorpublicinterfaceRandomGeneratorjava.util.Random的父接口APIstaticofgetDefaultpublicisDeprecated是否废弃doublesDoubleStreamdoubles()无限流[0,1)DoubleStreamdoubles(doublerandomNumberOrigin,d......
  • 20230608 java.util.concurrent.locks.AbstractQueuedSynchronizer
    介绍java.util.concurrent.locks.AbstractQueuedSynchronizerpublicabstractclassAbstractQueuedSynchronizerextendsAbstractOwnableSynchronizerimplementsjava.io.Serializable提供一个框架,用于实现依赖于先进先出(FIFO)等待队列的阻塞锁和相关同步器(信号量、事件......
  • 20230608 java.util.concurrent.locks.Condition
    介绍java.util.concurrent.locks.ConditionpublicinterfaceConditionCondition将Object监视器方法(wait、notify和notifyAll)分解为不同的对象,通过将它们与任意Lock实现的使用相结合,从而产生每个对象具有多个等待集的效果。在Lock取代synchronized方法和语句的使用的地方......
  • 20230608 java.util.concurrent.locks.LockSupport
    介绍java.util.concurrent.locks.LockSupportpublicclassLockSupportAPIstaticsetCurrentBlockervoidsetCurrentBlocker(Objectblocker)设置当前线程的阻塞对象getBlockerObjectgetBlocker(Threadt)返回提供给最近一次调用尚未解除阻塞的park方法的阻塞......