How to implement multi-threading in C++
-
Hi, I need to implement the multi-threading using C++(Not VC++). What are the options available fot it. Thanks in advance. Regards Mahesh
this is not a question for the Managed C++ forum definitely...
TOXCCT >>> GEII power
[toxcct][VisualCalc 2.20][VCalc 3.0 soon...] -
this is not a question for the Managed C++ forum definitely...
TOXCCT >>> GEII power
[toxcct][VisualCalc 2.20][VCalc 3.0 soon...]Actually, I wonder why there is no C++ forum here. If he posts the same question in "Visual C++" forum, people will complain that it is not Visual C++ question. If he posts it in here, people still complain that it is not a Managed C++ forum. Poor C++ programmers... As to the question, you have to use _beginthreadex and _endthreadex. These functions are in C++ standard library and they know how to free the resources of your threads. Don't use beginthread and endthread because they are obsolete. Neither should you use windows CreateThread and ExitThread because Win32 functions don't know about C++ library and may not be able to free the resources adequately. As a reference I would recommend Jeffrey Richter "Programming Applications for Microsoft Windows". He talks about multithreading, multiprocessing, memory structure (very interesting things like Address Windowing Extensions), exceptions, and other useful stuff. It may be difficult to find this book though. Amazon does not sell it any more.
-
Actually, I wonder why there is no C++ forum here. If he posts the same question in "Visual C++" forum, people will complain that it is not Visual C++ question. If he posts it in here, people still complain that it is not a Managed C++ forum. Poor C++ programmers... As to the question, you have to use _beginthreadex and _endthreadex. These functions are in C++ standard library and they know how to free the resources of your threads. Don't use beginthread and endthread because they are obsolete. Neither should you use windows CreateThread and ExitThread because Win32 functions don't know about C++ library and may not be able to free the resources adequately. As a reference I would recommend Jeffrey Richter "Programming Applications for Microsoft Windows". He talks about multithreading, multiprocessing, memory structure (very interesting things like Address Windowing Extensions), exceptions, and other useful stuff. It may be difficult to find this book though. Amazon does not sell it any more.
RainbowWyrm wrote:
I wonder why there is no C++ forum here
the question is legitimate. consider the fact though that you are on CodeProject on a web site dedicated to the Microsoft development technologies... (Visual Studio, etc...)
TOXCCT >>> GEII power
[toxcct][VisualCalc 2.20][VCalc 3.0 soon...] -
RainbowWyrm wrote:
I wonder why there is no C++ forum here
the question is legitimate. consider the fact though that you are on CodeProject on a web site dedicated to the Microsoft development technologies... (Visual Studio, etc...)
TOXCCT >>> GEII power
[toxcct][VisualCalc 2.20][VCalc 3.0 soon...]Yeah, but sometimes, you got to stay platform-independant while still working in Visual Products (though that kinda limits you to C++). For starters: I got MS VC++ 2005 Express. I use it to develop a OpenSource-Qt freeware tool. If I have Qt-questions, I AM gonna ask them in a Qt-Forum, but if I am stuck with VS-Problems or Standard-C++ issues, I'd rather ask on CodeProject.
-
Yeah, but sometimes, you got to stay platform-independant while still working in Visual Products (though that kinda limits you to C++). For starters: I got MS VC++ 2005 Express. I use it to develop a OpenSource-Qt freeware tool. If I have Qt-questions, I AM gonna ask them in a Qt-Forum, but if I am stuck with VS-Problems or Standard-C++ issues, I'd rather ask on CodeProject.
Sebastian Schneider wrote:
if I am stuck with VS-Problems or Standard-C++ issues, I'd rather ask on CodeProject
yeah... that's what the Visual C++ forum is for... C++/CLI forum is for managed C++ (you know, thet stufs for the .NET framework....)
TOXCCT >>> GEII power
[toxcct][VisualCalc 2.20][VCalc 3.0 soon...]