Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added starvation defn

...

Wiki Markup
*synchronization* : "The Java programming language provides multiple mechanisms for communicating between threads. The most basic of these methods is _synchronization_, which is implemented using monitors. Each object in Java is associated with a monitor, which a thread can lock or unlock. Only one thread at a time may hold a lock on a monitor. Any other threads attempting to lock that monitor are blocked until they can obtain a lock on that monitor." \[[JLS 05|AA. Java References#JLS 05]\].

Anchor
starvation
starvation

starvation : A condition wherein one or more threads prevent other threads from accessing a shared resource over extended periods of time. For instance, a thread that invokes a synchronized method which performs some time consuming operation, starves other threads.

Anchor
thread-safe
thread-safe

Wiki Markup
*thread-safe* : An object is thread-safe, if it can be shared by multiple threads without the possibility of any data races. "A thread-safe object performs synchronization internally, so multiple threads can freely access it through its public interface without further synchronization." \[[Goetz 06|AA. Java References#Goetz 06]\]. Immutable classes are thread safe by definition. Mutable classes may also be thread-safe if they are properly synchronized. 

...