[erlang-questions] Why single-assignment with non-shared state?

Tobias Gerdin tobias.gerdin@REDACTED
Sun Oct 21 15:04:34 CEST 2007


But in Erlang since state is not shared between processes you would  
never get race conditions anyway. Single-assignment makes a lot of  
sense when engaging in shared-memory thread-based programming, but  
since that is not the case in Erlang I was curious of the philosophy  
behind single-assignment in Erlang's case.

On 20 oktober 2007, at 13.37, Cameron Kerr wrote:

> If you can only assign to a variable once, you cannot have race  
> conditions.
>
> On 20/10/2007, at 10:50 PM, Tobias Gerdin wrote:
>
>> Hi there,
>>
>> I do not understand why the single-assignment restriction exists in
>> Erlang (even though I very much enjoy functional programming) given
>>> that processes do not share state. What is the problem with mutable
>>> state in a concurrent system when other processes cannot access  
>>> other
>>> processes' state?
>>>
>>> I was hoping someone could enlighten me on this matter.
>>>
>>>
>>> Regards,
>>>
>>> Tobias




More information about the erlang-questions mailing list