《Folly库代码赏析》7):Executor
文章目录
Folly 的余下内容分为
- [ ]
synchronization
- [ ]
- [ ]
memory
- [ ]
- [ ]
logging
- [ ]
- [ ]
io
- [ ]
- [ ]
gen
- [ ]
- [ ]
fibers
- [ ]
- [ ]
executors
- [ ]
- [ ]
concurrency
- [ ]
classDiagram
Executor
Executor <|-- IOExecutor
Executor <|-- ThreadPoolExecutor
IOExecutor <|-- IOThreadPoolExecutor
ThreadPoolExecutor <|-- IOThreadPoolExecutor
ThreadPoolExecutor <|-- CPUThreadPoolExecutor
Executor <|-- DrivableExecutor
Executor <|-- ManualExecutorExecutor
KeepAlive是对Executor的安全引用,Executor析构时会join所有KeepAlive对象。
ThreadExecutor
对于每个task启动一个线程执行,通过channel通知任务添加、删除、结束。golang中的select channel 用法。
ThreadPoolExecutor
IO/CPUThreadPoolExecutor的基类,提供了统计功能等通用信息。
IOThreadPoolExecutor
提供多个ioThread,每个ioThread允许event_base loop。
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论