What is the meaning of the term “thread-safe”?

前端 未结 18 1912
孤独总比滥情好
孤独总比滥情好 2020-11-22 13:51

Does it mean that two threads can\'t change the underlying data simultaneously? Or does it mean that the given code segment will run with predictable results when multiple t

18条回答
  •  春和景丽
    2020-11-22 14:09

    Thread-safe-code works as specified, even when entered simultaneously by different threads. This often means, that internal data-structures or operations that should run uninterrupted are protected against different modifications at the same time.

提交回复
热议问题