The main multithreading in C / C ++ - tips, tricks, guidance, some direction?

I would like to learn how to create a multi-threaded application, but I don’t even know where to start.

How do most people implement multithreading? Do they use the acceleration library? Is there any other way to do this? (using standard C / C ++)

I understand the concept, but I don’t know at all where to even begin to really learn how to do it. Can anyone recommend anything?

http://msdn.microsoft.com/en-us/library/7t9ha0zh%28v=VS.80%29.aspx & lt --- --- Are these standard C ++ or some versions only for Microsoft?

Is it true that multithread libraries are contained in the Windows API? I found an example on MSDN ( http://msdn.microsoft.com/en-us/library/esszf9hw%28v=VS.80%29.aspx ) and the functions it uses (ReleaseMutex, etc.) seem to be are in windows.h. Is this what most people use when programming Windows?

+6
c ++ c multithreading
source share
3 answers

The Boost library is a cross-platform way to use threads.

Most people use winapi or pthreads . Pthreads was originally used on POSIX systems, but there is a port for mingw that allows it to be used on windows as well.

I would recommend using boost if you absolutely need a cross-platform solution or if you already have related libraries. If you are developing for Windows or POSIX, use winapi or pthreads respectively.

+3
source share

If you are looking for a simple performance boost in your application using OpenMP multithreading, this is a simple library that will allow your program to scale across multiple cores, which only requires #pragma in your code to parallelize blocks of code or loops with additional parameters for poor performance.

It is not easy to resolve crude parallelism as a graphical interface / processing / IO in the application, but makes it easy to see multi-threaded performance on multi-core machines with a lot of crunches.

+2
source share

If you have never discussed multithreading before, I would advise you to work with a tutorial like this one on a code project to get started.

0
source share

All Articles