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)

    The word which gives the key to the national vice is waste. And people who are wasteful are not wise, neither can they remain young and vigorous. In order to transmute energy to higher and more subtle levels one must first conserve it.
    Henry Miller (1891–1980)

    One sought not absolute truth. One sought only a spool on which to wind the thread of history without breaking it.
    Henry Brooks Adams (1838–1918)

    If we can find a principle to guide us in the handling of the child between nine and eighteen months, we can see that we need to allow enough opportunity for handling and investigation of objects to further intellectual development and just enough restriction required for family harmony and for the safety of the child.
    Selma H. Fraiberg (20th century)