Click to See Complete Forum and Search --> : Equivalent of "Thread" java in C++


javinpaul
January 14th, 2011, 07:53 PM
Hi All,

I am new member , my name is Javin Paul.

I have used Thread in java a lot but not used in C++ , can any one please guide me what is equivalent of java Thread in C++ ?


Thanks
Javin

D_Drmmr
January 15th, 2011, 05:09 AM
std::thread isn't supported by any compilers yet, so in the mean time you can use boost::thread.

ovidiucucu
January 15th, 2011, 06:39 AM
MFC library also implements CWinThread (http://msdn.microsoft.com/en-us/library/48xz4yz9(VS.80).aspx) class.
If not using MFC, boost, or other library, it's no sweat to implement your own Thread class based on CreateThread (http://msdn.microsoft.com/en-us/library/ms682453(VS.85).aspx) Windows API function.

I can presume that "Thread" you have mentioned in OP is part of a Java library/framework and not of Java language.

aamir121a
February 7th, 2011, 03:40 AM
"javinpaul" thread is something which is very OS specific , java abstracted the idea and made is part of the language construct within Java , however C++ is as basic you can get without getting OS specific . if you are looking for something which is OS neutral as in Java , then head over to QT

as in
http://qt.nokia.com , think of it as C++ which works across all platforms.

ovidiucucu
February 7th, 2011, 04:40 AM
Be sure that every language, library or framework has OS-specific stuff behind.
Once the question was posted in Visual C++ & C++ Programming > Multithreading forum, I can presume that desired target OS is Windows.
IMO, if cross-platform is not a must, then choosing a third-party little cute "OS neutral" monster like Qt, is not a very brilliant solution.

aamir121a
February 7th, 2011, 06:47 AM
some people have spend so much time doing Micro**ft stuff they can't think beyond it , lets face it they are struggling with one OS , how would they comprehend 3 or 4 ,

Maya 2011 from Autodesk responsible , top quality Hollywood animation and special effects was developed in QT for windows mac and Linux. It has produced web kit , now used by MAC in safari browser , over 20000 cross platform applications have used it , not to mention the KDE for linux is based on QT UI framework.

Language is only the tools , it is neither good or bad , it your own effort and understanding

QT has over 15 years of development and proven track record behind it , what they have achieved in term of language maturity is yet to be achieved by any C++ implementation including MS

ovidiucucu
February 7th, 2011, 10:01 AM
some people have spend so much time doing Micro**ft stuff they can't think beyond it , lets face it they are struggling with one OS , how would they comprehend 3 or 4 ,

Maya 2011 ...
When you are saying that some people are hooked in one OS and "can't think beyond it", then it's fair to say the same about the ones hooked in something like Qt. ;)

Just I have expressed one opinion in a Visual C++ forum, in a thread in which nobody asked about cross-platform.
From my side, there was not any intention to argue and/or start a flame about how great are whatever concepts, technologies or companies.

Pease respect my opnion, then I'll respect yours!