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:

    Pushkin’s composition is first of all and above all a phenomenon of style, and it is from this flowered rim that I have surveyed its seep of Arcadian country, the serpentine gleam of its imported brooks, the miniature blizzards imprisoned in round crystal, and the many-hued levels of literary parody blending in the melting distance.
    Vladimir Nabokov (1899–1977)

    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)

    First you find a little thread, a little thread leads you to a string, and the string leads you to a rope. And from the rope you hang by the ... neck.
    —A.I. (Albert Isaac)

    He had a gentleman-like frankness in his behaviour, and as a great point of honour as a minister can have, especially a minister at the head of the treasury, where numberless sturdy and insatiable beggars of condition apply, who cannot all be gratified, nor all with safety be refused.
    Philip Dormer Stanhope, 4th Earl Chesterfield (1694–1773)