Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://github.com/netty/netty/pull/3833
业务线程alloc, 结果被在netty4中 却被IO线程release掉的, 这导致pooledBuf前边那层基于threadLocal的cache出了些问题(就是业务线程alloc时不断的cache不命中, 因为release时归还到别的线程的cache中了) netty/netty#3833 norman的改法是: pooledBuf中绑定cache, 谁alloc的就rlease给谁, 这就又导致release时可能引起多个线程的竞争条件(比如可能存在这样的场景:线程1线程2都要release到线程3的cache中), norman用一个MPSC队列解决的这个竞争(MPSC就是多生产者单消费者), 这个队列倒是很有意思, 感兴趣参考jctools https://github.com/JCTools/JCTools
- Loading branch information