Top "Stdthread" questions

std::thread is a C++11 standard library type which runs a function a new thread

vector of std::threads

C++11 I am trying to make a vector of std::threads. The combination of the following three points says I …

c++ multithreading vector c++11 stdthread
When is it a good idea to use std::promise over the other std::thread mechanisms?

I am trying to establish some heuristics to help me decide the appropriate std::thread class to use. As I …

c++ c++11 stdthread
std::thread pass by reference calls copy constructor

Well I have an issue with passing data into a thread using std::thread. I thought I understood the general …

c++ multithreading c++11 copy-constructor stdthread
C++11: What happens if you don't call join() for std::thread

Given below: void test() { std::chrono::seconds dura( 20 ); std::this_thread::sleep_for( dura ); } int main() { std::thread th1(test); …

c++ multithreading c++11 stdthread
Error creating std::thread on Mac OS X with clang: "attempt to use a deleted function"

Consider my test code: #include <thread> class Foo { public: void threadFunc() {} void startThread() { _th = std::thread(&Foo::…

multithreading macos c++11 clang stdthread
Waiting for a std::thread to finish

I am trying to clean up gracefully on program termination, so I'm calling join() on a std::thread to wait …

c++ multithreading c++11 stdthread
MinGW and std::thread

So I've been trying to get the following code to compile and run on Windows by using a MinGW compiler. #…

c++ windows c++11 mingw stdthread
How to write lambda function with arguments? c++

I want to call a method (for this example std::thread constructor) with lambda function, passing int value: int a=10; …

c++ argument-passing stdthread inline-functions
std::thread <unresolved overloaded function type> error

I am trying to spawn a thread from within my class and the thread executes a particular method in my …

c++ multithreading c++11 std stdthread
std::thread::join() hangs if called after main() exits when using VS2012 RC

The following example runs successfully (i.e. doesn't hang) if compiled using Clang 3.2 or GCC 4.7 on Ubuntu 12.04, but hangs if …

c++ visual-c++ c++11 stdthread visual-c++-2012