3 ms·
Do the steps of the pipeline implementation in Ruby run concurrently? I once did an Elixir course and really liked the pipelines. I continued implementing pipe
by zelphirkalt 4y ago
Do the steps of the pipeline implementation in Ruby run concurrently?
I once did an Elixir course and really liked the pipelines. I continued implementing pipelines with a Scheme macro, but not concurrently.
- Fire-Dragon-DoL 4y agoElixir pipelines are not concurrent, unless you use something that allows that (flow and probably stream behind the scenes)
- woodruffw 4y agoNot naively: this kind of pipelining is partial function application, not coordinated parallelism (the way Unix pipeliens are).
- AtlasBarfed 4y agoDoes anyone know any documentation on how UNIX achieves parallelism in pipelines, especially modern implementations? Is each stage of a piped command just another spun off process?
- woodruffw 4y agoYes, it's just that: each process in the pipeline is spawned, and then blocks as it waits for input from the previous step in the pipeline. I think a better way to think about it is that the UNIX model requires parallelism: without parallelism, each stage in the pipeline would need to fully buffer its intermediate state before forwarding it to the next stage.
- superdisk 4y ago> without parallelism, each stage in the pipeline would need to fully buffer its intermediate state before forwarding it to the next stage. That's how DOS implemented the pipe syntax I believe.
- masklinn 4y ago> Is each stage of a piped command just another spun off process? Yes. With, as the name says, a pipe inbetween.