Thread Safety - Levels of Thread Safety

Levels of Thread Safety

Software libraries can provide certain thread-safety guarantees. For example, concurrent reads might be guaranteed to be thread-safe, but concurrent writes might not be. Whether or not a program using such a library is thread-safe depends on whether it uses the library in a manner consistent with those guarantees.

Different vendors use slightly different terminology for thread-safety:

  • Thread safe: Implementation is guaranteed to be free of race conditions when accessed by multiple threads simultaneously.
  • Conditionally safe: Different threads can access different objects simultaneously, and access to shared data is protected from race conditions.
  • Not thread safe: Code should not be accessed simultaneously by different threads.

Thread safety guarantees usually also include design steps to prevent or limit the risk of different forms of deadlocks, as well as optimizations to maximize concurrent performance. However, deadlock-free guarantees can not always be given, since deadlocks can be caused by callbacks and violation of architectural layering independent of the library itself.

Read more about this topic:  Thread Safety

Famous quotes containing the words levels of, levels, thread and/or safety:

    “The country is fed up with children and their problems. For the first time in history, the differences in outlook between people raising children and those who are not are beginning to assume some political significance. This difference is already a part of the conflicts in local school politics. It may spread to other levels of government. Society has less time for the concerns of those who raise the young or try to teach them.”
    —Joseph Featherstone (20th century)

    “Almsgiving tends to perpetuate poverty; aid does away with it once and for all. Almsgiving leaves a man just where he was before. Aid restores him to society as an individual worthy of all respect and not as a man with a grievance. Almsgiving is the generosity of the rich; social aid levels up social inequalities. Charity separates the rich from the poor; aid raises the needy and sets him on the same level with the rich.”
    —Eva Perón (1919–1952)

    “We construct a narrative for ourselves, and that’s the thread that we follow from one day to the next. People who disintegrate as personalities are the ones who lose that thread.”
    —Paul Auster (b. 1947)

    “Love no man in good earnest, nor no further in sport
    neither, than with safety of a pure blush thou mayst in
    honor come off again.”
    —William Shakespeare (1564–1616)