dugenkui03 commented on issue #4142:
URL: https://github.com/apache/rocketmq/issues/4142#issuecomment-1099942336

   jdk文档的意思是当有至少有一个线程写数据时、任何访问HashMap的线程都要加锁、包括读写。
   
   如下 thread_write 正在写入数据并导致 HashMap的**结构正在发生变化**,thread_read 此时访问数据是不安全的。
   <img width="685" alt="image" 
src="https://user-images.githubusercontent.com/18216266/163542401-4decee7d-dc0a-4e34-b4bb-7727e2e93f5f.png";>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to