concurrency - What field's value of a partially initialized object could a reader thread see according to Java Memory Model? -




more specifically, assuming object partially initialized , field x initialized null object's constructor, possible other thread reading partially initialized object can see other value null?

if understand correctly, there's no guarantee in java memory model value null in such case. question is: considering cpu caches , jvm memory architecture, should reasonably expected value not null?

by default, reference member variables initialized null. if constructor had set field non-null value, it'd have been possible other threads see null or non-null value. if constructor setting value null (which seems redundant in simple scenario), not possible other threads see value other null (the value field ever had null, there no question of seeing other value)





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -