[concurrency-interest] File object is not immutable?
cheremin at gmail.com
Wed Feb 15 10:00:59 EST 2012
I was very surprised to see that field "path" in java.io.File is not
final. I was treating File object in concurrency area is something
like String -- fully immutable, and completely thread-safe, even
Am I right supposing that File object is _not_ thread safe by itself
(as String does), and it is programmer's responsibility to safe
publish it between threads? Or may be it is some kind of hidden magic,
which makes File safe, even without explicit final? I mean, there is
native calls to FileSystem in constructor and deserialization, which
can create membars implictly...
More information about the Concurrency-interest