apache / dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
https://dubbo.apache.org/
Apache License 2.0
40.55k stars 26.44k forks source link

关于netty4线程模型问题 #4662

Closed PAULWONGHZ closed 5 years ago

PAULWONGHZ commented 5 years ago

dubbo引入netty4之后, 有没有处理线程模型的问题? 业务线程执行以下代码, name字段不是volatile, 根据happens-before原则, 在序列化层可能看不到name值.

User user = new User(); //business thread user.setName("admin"); channel.write(user); ... encoder.encode(user); //io thread ...

beiwei30 commented 5 years ago

这个问题不可能出现的。