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

Re: C++ and threading howto for linux dev



In <[🔎] h5s9dt$745$3@ger.gmane.org>, Emanoil Kotsev wrote:
>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.
>>
>> 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".
>
>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.

It's certainly possible, but it requires to to you what a POD is, and 
when/how to use extern "C" and a few other things that a lot of C++ 
programmers do not need to worry about.

Since GLib, Qt Core, LibBoost, and "C++1x" all provide C++ 
bindings/abstractions of the threads, I would not write your own.  I can't 
recommend for or against Boost, but one of those 4 should fit your project.
-- 
Boyd Stephen Smith Jr.           	 ,= ,-_-. =.
bss@iguanasuicide.net            	((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy 	 `-'(. .)`-'
http://iguanasuicide.net/        	     \_/

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: