I’ve just started learning about thread safety. This is making me code a lot more defensively, perhaps too defensively.
Would using a functional language like Erlang completely rid me of this concern?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
in Erlang the unit of execution state isn’t a thread, but a process. yeah, it’s a lightweight kind of process implemented on top of threads; but it’s more like a process than a thread.
The main point is that processes don’t share state, they pass messages; while threads share everything by default, and have to arbitrate to avoid chaos.
thus, you don’t need thread safety since you’re not working with threads.