Subj : Re: Thoughts about threads in C++ To : comp.programming.threads From : Arash Partow Date : Mon May 30 2005 12:02 am Hi, It was only intended to be a wrapper nothing else, nothing more. Some people might find the simple light-weight approach useful. And as you mentioned for you it might have little value. As far as the extern C issue goes, why on earth would I want to be extern C'ing a C++ wrapper of an API which is already available in C? why wouldn't the person just use the standard pthread API in the first place? The only use for this API is in the context of simple C++ threading. As for locking etc, I have to disagree with you. What C++ is about is really left to the programmer. If *they* wanted to they could have the made the language more restrictive like java and have something like the synchronized syntax. But its not like that, C++ lets you do pretty much whatever you can get away with, and if you're happy with that, and if that gets the job done, then that should be enough. Bringing up the example of why the "finally" keyword doesn't exist in C++ just shows that what you think about this issue and what i think are two different things. As stated before this is a simple wrapper, no cool or esoteric patterns here, just simple wrapping of a C API into a C++ class. Also the derived thread class method/pattern (whatever), is pretty standard way of threading a piece of code in OO manner. Its popular, its simple to implement and understand, and has a very low over-head. Btw I noticed in your messaging example, you templated the ListenersCollection and Messaging classes with Mutex policies. Though in your example code you pass NoSynchronization, I'm assuming people can implement their own mutexing policies where by you invoke their implementations of lock and unlock? Wouldn't that be a form of technical hypocrisy or technopocrisy? ;) Regards Arash Partow __________________________________________________ Be one who knows what they don't know, Instead of being one who knows not what they don't know, Thinking they know everything about all things. http://www.partow.net .