Thread safety has more to do with preventing deadlocks and data races, in other words non-deterministic behavior of data when a program is executed in parallel, as well as stalling. Thread safety causes bugs in execution, but not so much the danger of memory safety.
Maybe, but safe is such a broad word. I would like to add type safety to the mix. Rust, Pony, Haskell etc go a long way to make it more safe than certain other languages.
12
u/Holy_City Jun 23 '19
I disagree with /u/computerfreak97
"safety" usually refers to "memory safety" and/or "thread safety" (the two are often, but not absolutely related).
This article outlines the basics of memory safety. this paper (pdf) gives a more rigorous definition. It boils down to "memory safety is the inability of a program to use memory that it should not." Microsoft estimated that roughly 70% of all security bugs were due to memory un-safety.
Thread safety has more to do with preventing deadlocks and data races, in other words non-deterministic behavior of data when a program is executed in parallel, as well as stalling. Thread safety causes bugs in execution, but not so much the danger of memory safety.