Thread Module in c++11

C++11 supports Thread library (http://en.cppreference.com/w/cpp/thread). If you are using it in your application you have to pass -pthread to g++ linker to inform it which sort of backend should be used for linking Thread library. If -pthread is not passed your application will end up with following execution error:

terminate called after throwing an instance of 'std::system_error'
 what(): Enable multithreading to use std::thread: Operation not permitted
Aborted (core dumped)

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s