[erlang-questions] Mnesia and concurrency

Yariv Sadan yarivvv@REDACTED
Fri Dec 22 19:35:15 CET 2006


How could one implement such a thing in Erlang? Assuming a table is
owned by a single process, and that process can only accept one
message at a time, how can multiple processes perform simultaneous
reads on the table?

Yariv

>
> No, the same goes for Erlang and Mnesia. The difference
> against other systems is that in Erlang we do not need
> separate OS threads to achieve this. It suffices to use
> separate Erlang processes (which may be hosted by any
> connected Erlang node). Any number of Erlang processes
> may read the same record without causing a locking
> conflict. But if one Erlang process is grabbing a write
> lock, it will get an exlusive lock for that record. The
> same principle is also valid for table locks.
>
> /Håkan
>




More information about the erlang-questions mailing list