chore: update the READMEs

This commit is contained in:
Andy Pan 2024-10-17 11:16:43 +08:00
parent 2a562a7c2a
commit 2d40f3041b
2 changed files with 6 additions and 4 deletions

View File

@ -22,10 +22,11 @@ Library `ants` implements a goroutine pool with fixed capacity, managing and rec
- Managing and recycling a massive number of goroutines automatically
- Purging overdue goroutines periodically
- Abundant APIs: submitting tasks, getting the number of running goroutines, tuning the capacity of the pool dynamically, releasing the pool, rebooting the pool
- Abundant APIs: submitting tasks, getting the number of running goroutines, tuning the capacity of the pool dynamically, releasing the pool, rebooting the pool, etc.
- Handle panic gracefully to prevent programs from crash
- Efficient in memory usage and it even achieves [higher performance](#-performance-summary) than unlimited goroutines in Golang
- Efficient in memory usage and it may even achieve ***higher performance*** than unlimited goroutines in Golang
- Nonblocking mechanism
- Preallocated memory (ring buffer, optional)
## 💡 How `ants` works

View File

@ -22,10 +22,11 @@
- 自动调度海量的 goroutines复用 goroutines
- 定期清理过期的 goroutines进一步节省资源
- 提供了大量用的接口:任务提交、获取运行中的 goroutine 数量、动态调整 Pool 大小、释放 Pool、重启 Pool
- 提供了大量用的接口:任务提交、获取运行中的 goroutine 数量、动态调整 Pool 大小、释放 Pool、重启 Pool
- 优雅处理 panic防止程序崩溃
- 资源复用,极大节省内存使用量;在大规模批量并发任务场景下比原生 goroutine 并发具有[更高的性能](#-性能小结)
- 资源复用,极大节省内存使用量;在大规模批量并发任务场景下甚至可能比原生 goroutine 并发具有***更高的性能***
- 非阻塞机制
- 预分配内存 (环形队列,可选)
## 💡 `ants` 是如何运行的