Skip to content

线程池 | YangMing's Blog #36

@learneryog

Description

@learneryog

http://ymblog.top/2019/06/04/%E7%BA%BF%E7%A8%8B%E6%B1%A0/

为什么要用线程池?单线程方式存在以下几个问题:

线程的工作周期:假设线程创建所需时间为T1,线程执行任务所需时间为T2,线程销毁所需的时间为T3,往往是T1+T3大于T2,所以如果频繁的创建线程会损耗过多的额外时间。
如果有任务来了,再去

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions