Haskell's Missing Concurrency Basics (2016)
snoyman.com
Haskell's Missing Concurrency Basics (2016)
1–10 of 27 posts
Re: Haskell's Missing Concurrency Basics (2016)
#2Re: Haskell's Missing Concurrency Basics (2016)
#3Re: Haskell's Missing Concurrency Basics (2016)
#4Re: Haskell's Missing Concurrency Basics (2016)
#5How does erlang/elixir do it? I've never really had any problems.
Re: Haskell's Missing Concurrency Basics (2016)
#6Thread-unsafe `println` is one of Clojure's quirks too!
Re: Haskell's Missing Concurrency Basics (2016)
#7How does erlang/elixir do it? I've never really had any problems.
Elixir newbie here. If I remember correctly IO is implemented as a process, which means that different write requests are processed sequentially in the order they arrive to the process. The following link has more information: http://erlang.org/doc/apps/stdlib/io_protocol.html
Therefore, when two processes (let's name them A and B) want to output something at the same time, the result is going to be AAAABBBB or BBBBAAAA (depending on the order in which the messages arrive in the mailbox), but never BBAABBAA or anything similar.
Re: Haskell's Missing Concurrency Basics (2016)
#8How does erlang/elixir do it? I've never really had any problems.
Elixir newbie here. If I remember correctly IO is implemented as a process, which means that different write requests are processed sequentially in the order they arrive to the process. The following link has more information: http://erlang.org/doc/apps/stdlib/io_protocol.html
Re: Haskell's Missing Concurrency Basics (2016)
#9Earlier quoted context omitted.
Elixir newbie here. If I remember correctly IO is implemented as a process, which means that different write requests are processed sequentially in the order they arrive to the process. The following link has more information: http://erlang.org/doc/apps/stdlib/io_protocol.html
Correct. Erlang (and therefore Elixir) stdio is implemented by means of sending messages to a process that does low-level writing to a console. When a single message is served, the other are queued up. Therefore, when two processes (let's name them A and B) want to output something at the same time, the result is going to be AAAABBBB or BBBBAAAA (depending on the order in which the messages arrive in the mailbox), bu…
When I first read your example, it sounded like you were saying that the IO process would exhaust all messages from one source process before processing any messages from the other, no matter what order they arrived in.