C++ Threading Proposal
Kevlin Henney
kevlin at curbralan.com
Sun Oct 3 09:01:39 BST 2004
In message <000401c4a6a6$e82160a0$eeb7490c at homefvra93mfsq>, Jim Rogers
<jimmaureenrogers at att.net> writes
[...]
>If you do maintain a similarity with Java, then you must decide how
>you want to implement a Thread class, and whether or not you want to
>implement anything similar to a Runnable interface. My personal choice
>would be to ignore the Java Runnable interface, since that is simply a Java
>work-around for the lack of multiple inheritance.
This is not the only motivation for this design, although it does also
satisfy that point of view. Delegation-based approaches (eg having a
Thread run a Runnable) have found more favour in terms of their design
strengths over recent years than inheritance-based approaches (eg
inheriting from Thread).
I certainly would not wish to see a standard C++ threading library
taking the retrograde step of adopting an inheritance-based model -- a
generic model based on function objects has been considered the most
natural approach for quite some time now.
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