Comments (7)
好的,明白了,感谢
from iogame.
是的
from iogame.
文档中:
this.requestMessageClientProcessorHook.processLogic 的默认实现是线程安全的;注意,这个线程安全指的是 userId 与线程做了关联绑定,同一个玩家执行业务是线程安全的
同一个用户是的业务逻辑是同一个线程处理的,是线程安全的。 其他的用户是不同的业务线程吗?
或者说一个逻辑服业务线程就只有一个,还是有多个?
from iogame.
文档中: this.requestMessageClientProcessorHook.processLogic 的默认实现是线程安全的;注意,这个线程安全指的是 userId 与线程做了关联绑定,同一个玩家执行业务是线程安全的
同一个用户是的业务逻辑是同一个线程处理的,是线程安全的。 其他的用户是不同的业务线程吗? 或者说一个逻辑服业务线程就只有一个,还是有多个?
默认的实现中有多个 Executor[],具体数量是不大于Runtime.getRuntime().availableProcessors() 的 2 次幂。假设 availableProcessors 的值分别为 4、8、12、16、32 时,对应的数量则是 4、8、8、16、32。
通过 userId 从 Executor[] 中取得对应的线程来处理业务逻辑,来避免并发问题;
可以先阅读相关文档 https://www.yuque.com/iohao/game/eixd6x#KA814
from iogame.
好的,多谢
from iogame.
再追加问一个问题:
客户端连接断开,逻辑服处理用户下线钩子的函数,和客户端业务线程是同一个线程吗?
是否会出现,在连接断开前的业务报文还在处理中,但用户下线钩子函数已经在处理甚至说处理完成了。
from iogame.
再追加问一个问题: 客户端连接断开,逻辑服处理用户下线钩子的函数,和客户端业务线程是同一个线程吗?
是否会出现,在连接断开前的业务报文还在处理中,但用户下线钩子函数已经在处理甚至说处理完成了。
是同一个线程,因为是 通过 userId 从 Executor[] 中取得对应的线程来处理业务逻辑,来避免并发问题;
from iogame.
Related Issues (20)
- 建议未来支持高性能序列化框架-flatbuffers和simple-binary-encoding HOT 5
- 框架里面使用的很多第三方jar 包太老了是否可以统一升级一下 HOT 6
- AbstractUserSessions.userIdMap安全删除 HOT 3
- 随着通讯时间的增加,导致linux服务器系统的线程数用完。 HOT 2
- IDEA没问题,打包后启动报错 HOT 7
- WebSocketVerifyHandler使用 HOT 4
- 在测试的时候遇到一个报错 HOT 1
- GameFlowEo的FlowContext可以不是必须的吗 HOT 2
- GameFlowContext的getRoom可以改成返回泛型吗 HOT 2
- [对接文档] 增强对接文档的扩展性,提供方便获取 action 、广播、错误码 ...等相关文档的信息,以便个性化扩展。 HOT 1
- SDK C# ,客户端代码生成;方便 Unity、Godot 对接。
- SDK TypeScript 客户端代码生成;方便 CocosCeator、或其他支持 TypeScript 的客户端对接。
- [对接文档] 增强,支持对接文档生成与扩展,包括文本文档生成、联调代码生成 ...等 HOT 1
- 测试用例跑不通 HOT 3
- 对外服高频率报错 HOT 2
- 对外服高频率报错: io.netty.channel.unix.Errors$NativeIoException: recvAddress(..) failed: Connection reset by peer 17:18:08.579 [iohao.com:external-netty-server-worker-7] WARN io.netty.channel.DefaultChannelPipeline -- An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception. HOT 2
- 顶号操作疑似bug HOT 7
- 关于 StatActionInOut.TimeRange 的 inRange(long time) 方法的准确性 HOT 5
- 获取所有活跃用户 HOT 4
- 获取活跃机器 HOT 3
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 iogame.