玩家一不小心
玩家一不小心
就拿玩家位置而言,另一种思路是,当产生6号包时,把前面尚未发送过的包删除,已发送的包还是应该走重传。 这需要对包做特殊设计,能够识别包的类型,这样某些包类型可以只取最后一个包。 (有些**状态同步**的游戏服务器可能会这么做优化)
这里不是内存语义的区别,而是从性能方面考虑的,Unsafe性能更好点,这些开源库大量使用Unsafe其实就是为了性能 (其实性能有没有差异,我并没测试过,如果说错了请理解)
@franz1981 I am working on it.
@franz1981 Did you forget to release `cChunk.prev` here ``` final void moveToNextConsumerChunk(R cChunk, R next) { // avoid GC nepotism cChunk.soNext(null); next.soPrev(null); // no need to cChunk.soIndex(NOT_USED) if (cChunk.isPooled()) {...
MpscLinkedQueue#fill ``` @Override public int fill(Supplier s, int limit) { if (null == s) throw new IllegalArgumentException("supplier is null"); if (limit < 0) throw new IllegalArgumentException("limit is negative:" + limit);...
#299 pull request
#307 pull request
@franz1981 fixed
@nitsanw Sorry, I forgot to run mvn build...
JCTools is a great library. I have read the source code of all queues and will not submit new issues or prs in a short time.