Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chan使用是否合理? #16

Open
zxq97 opened this issue May 23, 2023 · 1 comment
Open

chan使用是否合理? #16

zxq97 opened this issue May 23, 2023 · 1 comment

Comments

@zxq97
Copy link

zxq97 commented May 23, 2023

使用chan使得所有的请求在单实例中串行处理,是否会降低吞吐?
我理解本地库存最主要的目的,应该是当本地库存不足时,不去请求redis。保证本地库存源子操作这种需求源子操作或者用lock就可以解决,不必让所有请求的串行处理吧。
而且go chan底层也是基于lock实现的,通过benchmark chan 没体现出任何优势。
如果理解错误点 还望指正。

@zxq97
Copy link
Author

zxq97 commented May 23, 2023

使用chan使得所有的请求在单实例中串行处理,是否会降低吞吐?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant