8000 公用栈支持分组? · Issue #8 · cloudwu/coroutine · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
公用栈支持分组? #8
Open
@skywind3000

Description

@skywind3000

比如一个 schedule 里面有 100个 stack,每个 2MB,一共 200MB,每个栈,管理一组 coroutine
假设有 5000个 coroutine ,平均分布在 100组栈上,每组栈 50个 coroutine。

coroutine 被切走的时候,并不会马上拷贝栈,而会保留在那一个栈上,直到同一组的 coroutine 需要resume,才会把之前 on-stack 的 coroutine 拷贝走。

这样每个 stack 上保留的 coroutine 都是最近最活跃的 coroutine,栈拷贝的次数下降100倍。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0