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
// Start 启动节点
func (n *Node) Start() { n.setState(cluster.Work)
n.startTransporter() n.registerServiceInstance() n.proxy.watch(n.ctx) go n.dispatch() //处理请求和事件 n.debugPrint() n.runHookFunc(cluster.Start)
}
//麻将例子代码
不是只有dispatch这个协程处理消息吗
The text was updated successfully, but these errors were encountered:
node节点本身处理消息是单线程的,故而你在在没有多线程操作map的情况下是不需要加锁的。
Sorry, something went wrong.
感谢大佬的解答,逻辑单线程处理,实际项目中会成为性能瓶颈吗?逻辑中如果不是纯内存操作的话
node节点本身处理消息是单线程的,故而你在在没有多线程操作map的情况下是不需要加锁的。 感谢大佬的解答,逻辑单线程处理,实际项目中会成为性能瓶颈吗?逻辑中如果不是纯内存操作的话
理论上来讲单线程在绝大多数业务场景中都会是一个性能瓶颈点。故而开发者需要根据自身业务特点来选择合适的模型。在实际的业务开发过程中,一般都是结合各个模型的优缺点进行混用,并不存在一招吃遍天下的绝技。
No branches or pull requests
// Start 启动节点
func (n *Node) Start() {
n.setState(cluster.Work)
}
//麻将例子代码
不是只有dispatch这个协程处理消息吗
The text was updated successfully, but these errors were encountered: