ants icon indicating copy to clipboard operation
ants copied to clipboard

🐜🐜🐜 ants is a high-performance and low-cost goroutine pool in Go./ ants 是一个高性能且低损耗的 goroutine 池。

Results 40 ants issues
Sort by recently updated
recently updated
newest added

Hello, I am using Ants with fasthttp. Is it possible that this both packages are not compatible? My Program fetchs 15000 rows from a MysqlDB and request the HTML code...

help wanted
question
waiting for response

--- name: Pull request about: Add support for Run(ctx) interface --- ## 1. Are you opening this pull request for bug-fixs, optimizations or new feature? yes This is a pr...

enhancement
proposal
needs investigation

我看到pool用的是自己实现的自旋锁,而不是mutex,有点好奇性能,然后做了下性能测试: ```go 自旋锁版: goos: linux goarch: amd64 pkg: github.com/panjf2000/ants/v2 cpu: Intel(R) Xeon(R) Platinum 8269CY CPU @ 2.50GHz BenchmarkGoroutines-2 10 113619133 ns/op 8000001 B/op 100000 allocs/op BenchmarkAntsPool-2 9 114800650 ns/op 2349845...

help wanted
question

**What is your question about ants?** Please describe your question meticulously. stack或者loopQueue两种结构性能上和功能上都可以改造成一样的效果 为何需要两种数据结构?

help wanted
question

由于ants中var defaultAntsPool, _ = NewPool(DefaultAntsPoolSize),会在使用到该库的项目初始化时,先于项目的main.go执行,从而会多出一个协程; 很多项目单测中集成了go.uber.org/goleak,用于检测goroutine泄露,从而会导致测试失败,如下图: ![image](https://user-images.githubusercontent.com/15921519/183029685-15df0f79-c45f-450e-8a34-82fa038233e7.png) 查看ants代码,发现有一个Release()方法,可以释放掉worker,但释放需要一定时间,只能休眠一个足够长的时间(经验值是1s左右) ![image](https://user-images.githubusercontent.com/15921519/183030461-d9a833b5-5454-4049-8489-2cd251cc696f.png) ![image](https://user-images.githubusercontent.com/15921519/183030267-a8860a88-14c2-449d-8911-6cc0ca01d29a.png) 建议新增一个 ReleaseWaitAllWorkersExit()方法,调用后,确保所有worker都释放后才返回 ![image](https://user-images.githubusercontent.com/15921519/183030786-788a8df6-4123-4f62-befb-1454b8dbef9a.png) 另外几个可能相关的issue: https://github.com/panjf2000/ants/issues/212 https://github.com/panjf2000/ants/issues/225 --- related pr:https://github.com/panjf2000/ants/pull/245

proposal

java的 threadPoolExecutor里面有拒绝策略。其中callerRunsPolicy能够让 被池子拒绝的任务交给调用者自己执行 一些比较重要的任务是不希望被池子拒绝后丢弃的 希望ants pool也可以加一个这样的东西

proposal
waiting for response

… Invoke function without explicitly creating an array --- name: Pull request about: Propose changes to the code title: 'Multiple arguments pool func' labels: '' assignees: '' --- ## 1....

long-term

### Actions I've taken before I'm here - [X] I've thoroughly read the documentations on this issue but still have no clue. - [X] I've searched the current list of...

bug
waiting for response
needs investigation
needs more info

Correct the logic for locking the pool in the retrieveWorker function to prevent potential data races and deadlocks. The lock is now deferred until the end of the function, with...

waiting for response
needs investigation
needs more info