Comments (2)
嗯嗯,我也发现这个问题了,所以我在util.go里面写了一个ConnectionMap来管理客户端连接,它其实就是map加读写锁,所以效率较低。ConcurrentMap因为有死锁的bug,暂时没有使用,Github上有个项目go-concurrentMap,是高仿Java的ConcurrentHashMap,从测试数据来看效率非常高,如果你感兴趣可以看下,但实现很复杂,几乎是将Java的实现搬到Go来了,因为两种语言的内存模型不太一样,我没敢搬过来直接用,ConcurrentMap我还没来得及改,sorry
from tao.
我能想到的一个折中的方法,就是先IterKeys()把所有的key遍历一遍,放到slice中,然后遍历slice,再逐个删除
from tao.
Related Issues (20)
- 1.9没有sync.Map了 HOT 1
- 请教一下client的问题 HOT 3
- 请教一下“应用层心跳” HOT 1
- 代码中对TLV结构的拆包异常处理 HOT 1
- 几个疑点麻烦解答 HOT 5
- 有udp模式的吗 HOT 1
- 散列分配任务给worker不均匀 HOT 3
- 粘包、半包有处理么 HOT 1
- 限速 HOT 3
- server上如何获取worker list HOT 2
- 服务端如何针对每个client 保存临时数据,比如token\session等.自己实现? HOT 3
- 设置run
- 设置runAt
- 设置runAt或者runEvery会hang住read loop吗? HOT 6
- 请问tao还维护吗 HOT 1
- 请教一下,服务器是怎么检测客户端断开连接的? HOT 1
- writeLoop 可能写不完整 HOT 2
- Client连接异常情况,发包失败 HOT 1
- 简书上的设计文档打不开了,提示文章正在审核中
- Close()时reconnect()会导致ClientConn的Race问题
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 tao.