Is it easy to write traditional concurrency issues in Erlang?

I followed the operational system course, where we learned the usual problems of concurrency, like: the problem of philosophical philosophers, the problem of the producer-consumer, the problem of readers and writers ...

Since their main goal is to protect a common variable, does it make sense to try to solve these problems in Erlang? Or maybe I just need more Erlang training to figure out a solution?

thanks

+4
source share
2 answers

I understand the question, but these problems are related to locking and mutual exclusion.

Erlang's way of doing something through Actors avoids the lock problem. Creating producers and consumers, as well as readers and writers, is a good job at Erlang, but you will use messages instead of a shared variable to solve the mutual exclusion problem.

In Erlang, you "do not share anything."

+5
source

This link can help you.

I'm sure Erlang applications in the real world will have to deal with concurrency, while threads will struggle with certain resources.

There is a great book that covers the whole topic and much more, written by Joe Armstrong, creator of Erlang.

Erlang Programming: Software for a Parallel World

+1
source

Source: https://habr.com/ru/post/1286545/


All Articles