Erlang Versus Python

Ulf Wiger etxuwig@REDACTED
Wed Mar 1 09:44:00 CET 2000


> Date: Tue, 29 Feb 2000 16:23:36 -0500
> From: Vladimir Ulogov <gandalf@REDACTED>

> - Easy pipes. If I'm spawning some task using popen I'm having as much
> instances as I'd spawn those tasks. In the Erlang open_port with the
> same portname means the same port (please correct me if I'm wrong),
> os:cmd(unix:cmd) also non-parallel if spawned from the different tasks.

You are wrong about the open_port() semantics. Each call to 
open_port() leads to a new instance.

os:cmd(Cmd) was serialized because open_port() used fork() to 
create the external process. This could be disastrous if the VM 
was very large, since fork() maps the same amount of memory to 
the child process.

Nowadays, open_port() uses vfork(), which avoids this problem.
In the near future, os:cmd/1 will also change back.


/Uffe

Ulf Wiger, Chief Designer AXD 301         <ulf.wiger@REDACTED>
Ericsson Telecom AB                          tfn: +46  8 719 81 95
Varuvägen 9, Älvsjö                          mob: +46 70 519 81 95
S-126 25 Stockholm, Sweden                   fax: +46  8 719 43 44




More information about the erlang-questions mailing list