Mastering Object Visibility in Java
2024-2-27 04:0:5 Author: hackernoon.com(查看原文) 阅读量:11 收藏

Hackernoon logo

Mastering Object Visibility in Java by@infinity

Too Long; Didn't Read

In a single-threaded environment, any writes made to an object take effect immediately, ensuring that subsequent reads will reflect the updated state of the variable. However these same guarantees do not extend to a multi- threaded system. When the main thread writes to shared objects, these updates might not get visible to reader thread immediately. Other threads may see updated state for some variables while a totally obsolete value for other variables is totally obsolete. In this article, we explore this exact weirdness with object visibility.

featured image - Mastering Object Visibility in Java

Rishabh Agarwal HackerNoon profile picture


@infinity

Rishabh Agarwal


Tech Enthusiast!


Receive Stories from @infinity


Credibility

react to story with heart

RELATED STORIES

Article Thumbnail

Article Thumbnail

Article Thumbnail

Article Thumbnail

Article Thumbnail

L O A D I N G
. . . comments & more!


文章来源: https://hackernoon.com/mastering-object-visibility-in-java?source=rss
如有侵权请联系:admin#unsafe.sh