- 2024-09-19线程池
ThreadPoolExecutor构造方法publicThreadPoolExecutor(intcorePoolSize,intmaximumPoolSize,longkeepAliveTime,TimeUnitunit,Blockin
- 2023-12-13CompletableFuture + LinkedBlockingDeque 实现生产者消费者案例
设计要求:1.设计一个生产者生产,消费者消费场景;2.使用线程池 CompletableFuture+队列LinkedBlockingDeque实现;3.生产者生产的数据存储到长度为5的LinkedBlockingDeque队列,消费者消费从LinkedBlockingDeque队列中取数据;4.生产者和消费者均是多线程且不知道谁快谁慢,互
- 2023-06-04JUC知识点框架
JUC(java.util.concurrent)atomicAtomicBooleanAtomicIntegerAtomicLongAtomicReferencelocksAQS(AbstractQueuedSynchronizer)ReentrantLockConditionLockSupportReentrantReadWriteLockStampedLockAQS典型应用ReentrantLockCountDownLatchSemaphore
- 2023-04-05LinkedBlockingDeque介绍
//有一个内部类finalclassNode<E>,//用于包装每个节点的数据。另外有成员属性//Node<E>first,Node<E>last,//当前拥有元素数量intcount,容量intcapacity;//Eitem当前节点数据//Node<E>prev指向当前节点前驱节点
- 2022-12-13JUC包结构
atomiclocksExecutorAbstractExecutorServiceCallableExecutorDelayedExecutorServiceForkJoinPoolForkJoinTaskForkJoinWorkerThreadFutureFutureTaskThrea
- 2022-10-11LinkedBlockingDeque详解
LinkedBlockingDeque介绍【1】LinkedBlockingDeque是一个基于链表实现的双向阻塞队列,默认情况下,该阻塞队列的大小为Integer.MAX_VALUE,可以看做无界队列,但也可以设置容