[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: C++ and threading howto for linux dev



Boyd Stephen Smith Jr. wrote:

> In <[🔎] 20090811112355.2e38a8a3@vivalunalitshi.luna.local>, Micha Feigin
> wrote:
>>c is a subset of c++ so you can use the c api inside c++.
> 
> Not entirely true.  ISO 9899:1999 (C Programming Language) has a number of
> types that are not in ISO 14882:2003 (C++ Programming Language), at least.
> Also, the upcoming "C++1x" standard will not include the variable-length
> arrays feature from "C99".  There are certain valid C constructs that will
> cause errors in C++, not limited to using C++ keywords as C identifiers or
> using the sequence "//*" in code.
> 
> There is a common subset of C and C++ and it includes the majority of the
> C language and standard library, but do not mistake C as "C++ without
> classes".

Thanks Boyd, I'm not that familiar with C or C++ specifications, but that's
exactly what's happening when trying to use pthreads directly from c++ and
I understand completely well why.
It needs a wrapper but things with threads (actually concurrency) are more
complicated, so I think libboost would be for me the way to go. It looks
handy.

I'm not sure how much advantage and disadvantage is to write the code or
parts of it in C and the rest in c++. Not even sure if it's possible
without any cavities, but it fun to learn.

regards




Reply to: