Threading in C++

I want to execeute more than 2 function in C++ at same time , how could i do this process . I think it has been done by threading , But i want to know about threading .

Regard : Kamil
C++ does not have a built-in facility for threading, although there are a number of C++ libraries that support threading.
http://en.wikipedia.org/wiki/List_of_C%2B%2B_multi-threading_libraries


Well, technically, C++ does (now) have threading. Or rather the C++ standard library. But only from C++11.

std::thread
http://en.cppreference.com/w/cpp/thread/thread
(cplusplus.com doesn't have an entry for this yet...)

So if you're compiler is C++11 compliant, then go for that.

If yours isn't, then boost::thread can be used instead. This is more or less the new, standard one, except in a different namespace (there are differences, but these shouldn't matter for basic usage). So what you learn about boost::thread will mostly apply to std::thread, when compilers catch up with the standard.

Boost.org
http://www.boost.org/
Boost.Thread
http://www.boost.org/doc/libs/1_52_0/doc/html/thread.html

The alternative is to use system specific threading or a thread library as AbstractionAnon sugggested.

Andy
Last edited on
Topic archived. No new replies allowed.