golang/%E6%A0%B8%E5%BF%83%E7%9F%A5%E8%AF%86%E7%82%B9/%E5%AE%9E%E7%8E%B0%E9%98%BB%E5%A1%9E%E8%AF%BB%E7%9A%84%E5%B9%B6%E5%8F%91%E5%AE%89%E5%85%A8Map #40
Replies: 1 comment 3 replies
-
|
是不是少了rd方法呀 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
golang/%E6%A0%B8%E5%BF%83%E7%9F%A5%E8%AF%86%E7%82%B9/%E5%AE%9E%E7%8E%B0%E9%98%BB%E5%A1%9E%E8%AF%BB%E7%9A%84%E5%B9%B6%E5%8F%91%E5%AE%89%E5%85%A8Map
实现阻塞读且并发安全的map GO里面MAP如何实现key不存在 get操作等待 直到key存在或者超时,保证并发安全,且需要实现以下接口: 解析: 看到阻塞协程第一个想到的就是channel,题目中要求并发安全,那么必须用锁,还要实现多个goroutine读的时候如果值不存在则阻塞,直到写入值,那么每个键值需要有一个阻塞goroutine 的 cha...
https://golangguide.top/golang/%E6%A0%B8%E5%BF%83%E7%9F%A5%E8%AF%86%E7%82%B9/%E5%AE%9E%E7%8E%B0%E9%98%BB%E5%A1%9E%E8%AF%BB%E7%9A%84%E5%B9%B6%E5%8F%91%E5%AE%89%E5%85%A8Map.html
Beta Was this translation helpful? Give feedback.
All reactions