BookOwl / nemo

A fishy programming language.
The Unlicense
8 stars 1 forks source link

Better piping #1

Open BookOwl opened 7 years ago

BookOwl commented 7 years ago

Currently nemo uses threads and queues to implement piping. This isn't a very good solution for several reasons.

  1. Threads are heavy, and spawning a new thread for each part of a pipeline can't be very efficient.
  2. The order different parts of the pipeline are run in can't be controlled.

A single threaded solution would be much better. I've tried coroutines, but I can't get the code to work right without segmentation faults.

BookOwl commented 7 years ago

http://stackoverflow.com/questions/43237389/implementing-pipes-without-using-threads

BookOwl commented 7 years ago

futures (and specifically streams) seem like a good way to do this.