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

前端 未结 18 1915
孤独总比滥情好
孤独总比滥情好 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:10

    In simplest words :P If it is safe to execute multiple threads on a block of code it is thread safe*

    *conditions apply

    Conditions are mentioned by other answeres like 1. The result should be same if you execute one thread or multiple threads over it etc.

提交回复
热议问题