immutable « Thread Safe « Java Thread Q&A

Home
Java Thread Q&A
1.concurrency
2.Development
3.Exception
4.Notify
5.Operation
6.Socket
7.State
8.synchronize
9.Thread Safe
10.ThreadPool
Java Thread Q&A » Thread Safe » immutable 

1. Does using only immutable data types make a Java program thread safe?    stackoverflow.com

Is it true that if I only use immutable data type, my Java program would be thread safe? Any other factors will affect the thread safety? *Would appreciate if can provide an example. ...

2. final fields and thread-safety    stackoverflow.com

Should it be all fields, including super-fields, of a purposively immutable java class 'final' in order to be thread-safe or is it enough to have no modifier methods? Suppose I have a ...

3. How to set/get string in Java safely?    stackoverflow.com

I have read Java String class is immutable and thread-safe but I am still confused about whether the reference assignment for Strings is thread-safe or not. First question: If thread A calls ...

4. are final,volatile & immutable threadsafe?    coderanch.com

Sounds like a directly lifted homework question to me. We don't do your homework, but maybe I can give some clues. The keywords "final" and "volatile", plus the technique of immutable objects, are all things that can be used to ensure thread-safety. Of course, missing from this list is the most important keyword, "synchronized". However, there is no magic way of ...

5. question about safe publish and threadsafe for immutable object    coderanch.com

hi, i'm new in multi-threading, i'm a little confused about safe publish and threadsafe of immutable object. I know that immutable object is always threadsafe and can always be safely published thanks to initialization safety. does this mean that in the following code, the update() is threadsafe without synchronization? public Cache { private ImmutableObject holder; public update(...) { .... holder = ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.