[cpp-threads] High-level concurrency issues

Kevlin Henney kevlin at curbralan.com
Fri Oct 28 18:17:05 BST 2005


In message <200510281655.j9SGtu205589 at plg2.math.uwaterloo.ca>, Peter A. 
Buhr <pabuhr at plg.uwaterloo.ca> writes
>   Date: Mon, 17 Oct 2005 12:02:24 -0700
>   From: "Boehm, Hans" <hans.boehm at hp.com>
>
>   a) We didn't propose coroutines. I haven't seen much of a desire for
>   adding those to the language.
>
>If all you have is hammer, everything looks like a nail. ;-) Let me push a
>little longer on coroutines and then I'll sadly let it die if the Gods are
>against me. The killer app for coroutines is device drivers, which are mostly
>finite automata that can be coded directly as coroutines with very few errors.
>Think of it: working device drivers! Wouldn't that make Windows and Linux
>people happy? I'm also starting to believe most "pluggins" would be best
>implemented as coroutines, allowing the pluggin to easily retain state and
>execution location between calls to it.

It is perhaps worth point out that coroutines were part of the C++ 
repertoire in the early days. The task class was patterned after the 
coroutine facilities available in Simula 67 made available through the 
Process class. However, this class was never standardised or, I believe, 
even put forward for standardisation and, among people that know of it, 
I do not hear much demand for it.

I also suspect that the window of opportunity for such a feature may 
have closed, regardless of its merits. Certain coroutine-based OSs gave 
such co-operative multitasking a bad name, so selling the idea that 
device drivers would suddenly work as a consequence is likely to be an 
uphill marketing campaign!

Yes, there are programming benefits to be had, but I suspect that a 
proposal for multi-threading should probably not be mixed in with a 
proposal for coroutines.

Kevlin
-- 
____________________________________________________________

   Kevlin Henney                   phone:  +44 117 942 2990
   mailto:kevlin at curbralan.com     mobile: +44 7801 073 508
   http://www.curbralan.com        fax:    +44 870 052 2289
   Curbralan: Consultancy + Training + Development + Review
____________________________________________________________



More information about the cpp-threads mailing list