Comments (3)
The reason why I chose spinlock over mutex is that the goroutine would be put into wait queue and awaked when the mutex lock is released by another goroutine, but most of the cases using ants
won't hold the lock for a long time, which makes all those actions of mutex worthless, so there will be a higher performance using spinlock.
from ants.
@jjshi
Do you still have questions about this? or other questions? If not, please close this issue, thanks!
from ants.
thanks @panjf2000
from ants.
Related Issues (20)
- [Question]: 主动kill任务 HOT 1
- [Bug]: ants.NewPoolWithFunc(1000, dorequest),当dorequest函数中不使用fmt.Println时,CPU耗尽;当使用打印函数时,CPU正常 HOT 6
- [Question]: can you please confirm the proper way for variables to be sent using ants? HOT 1
- [Question]: 清理过期worker一点疑问 HOT 1
- [Bug]: go.mod 中的go version(1.13)和ants.go存在不匹配 HOT 2
- [Bug]: Potential goroutine leak in pool.go HOT 3
- [Question]: How can I verifier the max goroutine count in pool is correct HOT 2
- [Question]: 为什么不提供一个任务包装,等待,获取任务结果 HOT 1
- [Question]: How to get meaningful statistics on a function pool? HOT 2
- [Question]: ants.Submit() question HOT 4
- [Question]: set max block task, but not return err when block task num more than set value HOT 1
- [Feature]: Add panicHandlerBuilder HOT 3
- [Question]: Can ants execute tasks in order? HOT 1
- [Bug]: 设置了ants.WithExpiryDuration(5*time.Second) 没起作用,导致pool满后一直未释放worker,阻塞新task HOT 1
- [Question]: 在mac上运行自带的压测代码,antspool的并发不如原生的goroutine HOT 1
- 使用ants嵌套并发无法正确取消上下文
- [Feature]: 144bytes allocated consistently just using ants.Submit( without doing anything HOT 2
- [Bug]: Crashed running this in 192 core cpu aws c6a 384 gb ram cloud instance HOT 2
- [Question]: possible to provide advise on when should we use this gopool vs ants? HOT 1
- [Bug]: A potential goroutine leak in pool.go HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ants.