[erlang-questions] If you could rename ports, what would you call them?
Tue Oct 5 21:34:00 CEST 2010
On 5 okt 2010, at 17.04, Joe Armstrong wrote:
> But they shouldn't have been different - sure they have a differnt way
> of being created.
In the Erlang multiprocessor prototype by Pekka Hedqvist and me, implemented 1997, we moved towards this
Not because it was pretty but because it was simple (and nice looking) ;-)
One thing we did was to remove (nearly) all synchronous calls in the VM, even process_info was implemented
with signals (primitive messages).
Ports and processes both used a common structure (Task) and a common signal interface.
If you have not read it, here is the link. I think it is nice reading. Note that multicore was not present at the time.
We run it on a super expensive PC with 4 processors called four roses, thanks Bjarne ;-)
It is fun to see that we thought that we should use Pascal like "pseudo code" to be political correct ;-)
> There should be the notion of "creating a thing that behaves like a
> process" that is actually
> not a process, which which behaves like a process. Ets tables and
> ports should have
> been "things that behave like processes" - they should respond to messages and
> send exits when they die and so on. If they had behaved like processes
> then life would be
> easier and more regular ... If ports where pids then one would be able
> to access ports on
> remote nodes via their pids (just like remote pids in distributed erlang).
> Even if at the usage level they behave the same way from the POV of
> an external process, they're not created the same way (``open_port``
> vs ``spawn`` and a bunch of control functions dumped into the
> ``erlang`` module), and you also need to distinguish them when
> *implementing* them. And I'm guessing that's where Tony is looking for
> a better name.
>> If down the line ports and pids are better merged (in both external interface and implementation details) then maybe "ports" as a name/concept can disappear, but I don't think that's the case at the moment, you still need to refer to them as entities separate from pids when talking about implementing things in erlang.
> The erlang view of the world is "everything is a process" - all you
> should need to know
> is how to create a process and what protocol the process obeys -
> otherwise these things should
> obey "process semantics" this should be true for ets tables and ports ...
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
More information about the erlang-questions