We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
map赋值时
函数首先会检查 map 的标志位 flags。如果 flags 的写标志位此时被置 1 了,说明有其他协程在执行“写”操作,进而导致程序 panic。这也说明了 map 对协程是不安全的。
但flags本身的线程/协程安全性如何保证呢?如果两个协程恰好同时进行写,flags此时还没有进入写状态,怎么办呢?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题描述
map赋值时
但flags本身的线程/协程安全性如何保证呢?如果两个协程恰好同时进行写,flags此时还没有进入写状态,怎么办呢?
The text was updated successfully, but these errors were encountered: