1. 6

    This entire article seems to miss the point of goroutines, which is to make context switching between them cheap by avoiding system calls.

    Making the workload be “sleeps” is not at all a showcase because they’d just wind up putting threads to sleep.

    1. 5

      The article is explicit about not discussing context switches. The point is to succinctly demonstrate that Linux threads do not use orders of magnitude more RAM. It isn’t a discussion of the tradeoffs between various concurrency models.

      I’d love to read an article that quantifies the overall macro difference between threads, stackful coroutines and stackless coroutines myself.

      1. 0

        The article is explicit about not discussing context switches. The point is to succinctly demonstrate that Linux threads do not use orders of magnitude more RAM.

        Well, OK, but then the title is more than a little disingenuous, isn’t it?

        1. 1

          I don’t think so. To me, the title seems to be a succinct summary of the content. I do wish I had s/light/small/ before publishing, but “small” didn’t occur to me back then. Nevertheless, light/heavy is used when talking about size in memory, and my usage seems to be OK.

          It also true that people often (more often) use “light” to describe overall performance difference in this context, and the title is ambiguous. There’s the first paragraph for disambiguation.

          Aesthetically, I just love loud ambiguous titles, a-la “Linear Types Can Change the World” :-) I understand that that leads to failure in communication in some cases, but don’t see this as a big problem.

          1. 4

            The problem is that goroutines are significantly lighter than threads, when using the more common definition of light. That’s not ambiguity.

    1. 1

      Love that the “use bash for math” block uses bc and not bash. Because it’s parody I can’t tell if the author is kidding.

      1. 1

        Are the relative run-times of the images representative of the O() of the algorithms?