Hello all,
does anyone know a good tutorial on working with (programming) threads in Visusal Studio 2005? Not MFC related, just native C++ (no .NET)
Thanks
Hello all,
does anyone know a good tutorial on working with (programming) threads in Visusal Studio 2005? Not MFC related, just native C++ (no .NET)
Thanks
Win32 Multithreaded Programming
http://www.amazon.com/Win32-Multithreaded-Programming-Aaron-Cohen/dp/1565922964
Also try some of the free undergraduate podcasts on operating systems. You can find theoretical discussions on locking, multithreading, etc. (the one I know of is from Berkeley and is based on JAva, but still relevant)
Try one of these articles on codeproject.com:
http://www.codeproject.com/KB/threads/threadobject.aspx
http://www.codeproject.com/KB/winsdk/Win32_Event_Handling.aspx
Instead of using Win32 threads directly, I'd consider using a thread wrapper such as Boost threads. These are cross platform so porting your application later will be easier.
You may take a look at https://computing.llnl.gov/tutorials/openMP/. This doesn't concern all concepts of multithreading in VC++, but OpenMP only, which VC++ supports. OpenMP is easy to use in some simple cases of multithreading, for instance independent iterations in loop, independent blocks of code which can be executed concurrently. Although OpenMP is not so flexible in comparison with other approaches but it is very easy to use.
To enable OpenMP you need to switch it on in the project properties "C/C++/Language/OpenMP Support"