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

browse及update,是两个操作,多线程下会不对 #7

Open
ethan-202285 opened this issue Jun 23, 2022 · 1 comment
Open

browse及update,是两个操作,多线程下会不对 #7

ethan-202285 opened this issue Jun 23, 2022 · 1 comment

Comments

@ethan-202285
Copy link

每次用户操作,首先要调用browse接口,来确认“是否允许用户的这一次操作”。

如果被“允许操作”,操作完成后,再调用update接口,将缓存计数值+n。

如果用户同时调用browse,那么全部是通过的,即使打开_writeThrough,由于是异步去更新,所以即使k.base > value返回null,对于browse也没有影响。

@heiyeluren
Copy link
Owner

对的,谢谢。

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

2 participants