Re: [dev] convergence

From: Sam Watkins <sam_AT_nipl.net>
Date: Wed, 2 Jan 2013 12:13:13 +1100

On Wed, Jan 02, 2013 at 12:04:21PM +1100, Daniel Bryan wrote:
> On the other hand, it's not the fact that C is compiled that makes it
> more efficient than the interepreted bash - it's the fact that C is just
> reading files and filling buffers, whereas Bash is doing a dozen
> fork+execs.

Yes. It's possible to implement pipelines and parallel tasks using
coroutines in C, which is a little scary / weird but can be very efficient.
Coroutines can be used with multi-threading, using a worker thread per core.

http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html

But for many tasks, it's simpler just to fork! I seldom find the shell
with its process-happy approach becomes too slow or heavy.
Received on Wed Jan 02 2013 - 02:13:13 CET

This archive was generated by hypermail 2.3.0 : Wed Jan 02 2013 - 02:24:04 CET