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)

    It launch’d forth filament, filament, filament, out of itself,
    Ever unreeling them, ever tirelessly speeding them.

    And you O my soul where you stand,
    Surrounded, detached, in measureless oceans of space,
    Ceaselessly musing, venturing, throwing, seeking the spheres to connect them,
    Till the bridge you will need be form’d, till the ductile anchor hold,
    Till the gossamer thread you fling catch somewhere, O, my soul.
    Walt Whitman (1819–1892)

    ... what a family is without a steward, a ship without a pilot, a flock without a shepherd, a body without a head, the same, I think, is a kingdom without the health and safety of a good monarch.
    Elizabeth I (1533–1603)