4 ms·
Erlang does that. The logic inside erlang processes look synchronous but outwardly its all async. For example you can send a message to a different process, ev
by reddit_clone 9y ago
Erlang does that. The logic inside erlang processes look synchronous but outwardly its all async.
For example you can send a message to a different process, even running on a different machine and wait for the reply right there in the next line. It doesn't hold any OS threads.
- he0001 9y agoIntriguing thought, async to what? If a program needs the input before continuing doesn't it need to wait and therefore hold the program flow and therefore stop, even in erlang?
- reddit_clone 9y ago>If a program needs the input before continuing doesn't it need to wait Erlang applications are developed using message passing Actors which are implemented as very light weight processes/green-threads. So your process that sent a message can wait for the reply synchronously. It doesn't hold anything up in the overall application. You can have hundred of thousands of these processes running in a node. Do check it out. It is very liberating. Why it is not vastly more popular is a mystery to me.
- he0001 9y agoWhile it's possible to have thousands of these processes running, it's completely up to the problem domain for it to be useful. If it wouldn't be bound by the problem domain you wouldn't need to write actors either.