edwinallenz

edwinallenz

Getting stdio process ID

Inside IEx when I run Process.whereis(:standard_error) I got the PID, but not when I run Process.whereis(:standard_io) . Who knows why should this happen and how to get the PID from : stdio ?

Marked As Solved

rvirding

rvirding

Creator of Erlang

That is because the i/o system and the error handling behave in different ways. For the error handling there is a central server process registered under the name :standard_error but this is not case for the i/o system. The best way to view an erlang/elixir system to think OS with many tasks and each one has its own i/o system.

You will find a description of this in the link in the erlang rationale I wrote many years ago Robert on anything: The Erlang Rationale . Towards the end it describes the i/o system and the “task” structure in erlang. You actually hit when you do a ^G in the shell.

Strangely enough this was the first time much of the rationale for erlang was actually described, about 10-15 years after it was designed. This was because we had so thought about it and discussed it we felt it was self-evident that this was the way it should be done. We found out later that not everyone thought the same way, some had not grasped the beauty of our design. :smile:

In The Erlang I/O Protocol — OTP 29.0.2 (stdlib 8.0.1) you will find a description of the i/o-protocol as it is today.

10
Post #1

Also Liked

rvirding

rvirding

Creator of Erlang

Fred’s blog gives a very good description of how it looks and why it looks like that. We had OS inspired thinking behind the design of the system. That’s why I like to say that Erlang is not a language with concurrency but a OS with a language. Elixir buys straight into this though iex is not quite as concurrent as the Erlang shell.

OvermindDL1

OvermindDL1

Lol, a lot of mathematical equations may be self-evidently beautiful, but that doesn’t mean everyone understands it. :wink:

/me grumbles about pi being the wrong value…

rvirding

rvirding

Creator of Erlang

Not directly that I know of. Stdio doesn’t work through a registered process but uses the default process group leader. This is where it goes when you read/write without giving an i/o device.

Last Post!

rvirding

rvirding

Creator of Erlang

Fred’s blog gives a very good description of how it looks and why it looks like that. We had OS inspired thinking behind the design of the system. That’s why I like to say that Erlang is not a language with concurrency but a OS with a language. Elixir buys straight into this though iex is not quite as concurrent as the Erlang shell.

Where Next?

Popular in Questions Top

vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42576 114
New

We're in Beta

About us Mission Statement