Threads and Processes:
>Spawning and Joining threads
Compiler: g++ -std=c++11 -pthread
Launching and joining threads:
[cpp]std::thread t ([] () {std::cout << "Hello worlds!\n";});
t.join();[/cpp]
Movable but non copyable
[cpp]std::thread x,y; x=y; //error! cnnot copy from lvalues
std::vector<std::thread> v(10);
pool[3] = std::thread(f);//can assign from rvalues
swap(x,y);
x.swap(y)[/cpp]
[cpp]#include <vector>
#include <iostraem>
#include <thread>
#include <numeric>
[/cpp]