Skip to content

控制协程(goroutine)的并发数量 | Go 语言高性能编程 | 极客兔兔 #116

@geektutu

Description

@geektutu

https://geektutu.com/post/hpg-concurrency-control.html

Go 语言/golang 高性能编程,Go 语言进阶教程,Go 语言高性能编程(high performance go)。本文介绍了 goroutine 协程并发控制,避免并发过高,大量消耗系统资源,导致程序崩溃或卡顿,影响性能。主要通过 2 种方式控制,一是使用 channel 的缓冲区,二是使用第三方协程池,例如 tunny 和 ants。同时介绍了使用 ulimit 和虚拟内存(virtual memory)提高资源上限的技巧。

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions