This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // compile as g++-4.7 --std=c++11 threads.cc -lpthread -o threads | |
| // g++ 4.7.2 will compile fine without the -lpthread, but (at least on my machine) the resulting binary burns and dies. -lpthread does need to occur after the .cc to work, for reasons not clear to me. | |
| #include <iostream> | |
| #include <thread> | |
| #include <mutex> | |
| #include <chrono> // timing, aw yeah | |
| #include <atomic> | |
| #include <cmath> // later irrelevant |
NewerOlder