• Java线程池原理与架构分析


     /**
         * 一.线程池:提供了一个线程队列,队列中保存着所有等待状态的线程。避免了创建与销毁额外开销,提高了响应速度
         * 二.线程池的体系结构
         * java.util.concurrent.Executor:负责线程使用和调度的根接口
         *      |--**ExecutorService 子接口:线程池的主要接口
         *          |--ThreadPoolExecutor 线程池实现类
         *          |--ScheduledExecutorService 子接口:负责线程的调度
         *              |--ScheduledThreadPoolExecutor: 继承了ThreadPoolExecutor,实现了ScheduledExecutorService
         * 三、工具类: Executors
         * ExecutorService newFixedThreadPool()创建固定的线程池
         * ExecutorService newCachedThreadPool():缓存线程池,线程池的数量不固定,可以根据需求自动的更改数量。
         * ExecutorService newSingleThreadExecutor() 创建单个线程池。线程池中只有一个线程
         *
         * ScheduledExecutorService newScheduledThreadPool():创建固定大小的线程,可以延迟或者定时的执行任务。
         */

    后序内容在:  https://www.zybuluo.com/huangyichun/note/751771

  • 相关阅读:
    Golang 函数
    Golang type
    Golang 分支控制和循环
    Golang 字符型
    Golang运算符
    final 和 static 的区别
    Golang标识符命名规则
    Golang值类型与引用类型
    Golang指针
    启动 jvm 参数小总结
  • 原文地址:https://www.cnblogs.com/huangyichun/p/7099653.html
Copyright © 2020-2023  润新知