Linux multithreading would include the pthreads library (in most cases). What is the equivalent library used by MSVC?

I need to know which APIs / libraries are used for multithreading using MSVC. If there are more than one, let me know what is the most widely used.

If my question sounds too naive because I have never done threads before, and from my past experience I know that there are people here who can make me start / point me in the right direction, where I can start.

+3
source share
3 answers

Like others, you can use CreateThread or _beginthread or threadpool APIs, a process and thread reference is better for Win32 threading, you can also use boost :: thread, which is very close to the std :: thread standard of C ++ 0x standard .

Another option if you are using Visual Studio is to look at the parallel template library and the asynchronous agent library that are part of Microsoft Concurrency Runtime (ConcRT) and are new in Visual Studio 2010. There are several practical topics in the link that may help you get started here.

API ConcRT - API- "", API , . , . boost:: thread, API- , API- CreateThread/ThreadPool, API-, CreateThread (Concurrency:: Scheduler:: ScheduleTask, ).

-Rick

+2

Threading Windows , API Win32. , , CreateThread. MSDN .

: , MSVCRT, _beginthread(). , MSVCRT.

+4

As @Greg said, you can use CreateThread to create a thread in windows. Another option is to use boost threads, which IMHO provide a much better interface for handling them.

+2
source

Source: https://habr.com/ru/post/1725458/


All Articles