Advertisement
PsichiX

XeCore3 - Test Concurrency - main.cpp

Oct 24th, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2. #include "TestThread.h"
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     cout << ">>> hardware concurrency: " << XeCore::Common::Concurrent::Thread::hardwareConcurrency() << endl;
  9.  
  10.     cout << ">>> create threads" << endl;
  11.     TestThread* t0 = xnew TestThread();
  12.     TestThread* t1 = xnew TestThread();
  13.     TestThread* t2 = xnew TestThread();
  14.     TestThread* t3 = xnew TestThread();
  15.  
  16.     cout << ">>> start threads" << endl;
  17.     t0->start();
  18.     t1->start();
  19.     t2->start();
  20.     t3->start();
  21.  
  22.     cout << ">>> join threads" << endl;
  23.     t0->join();
  24.     t1->join();
  25.     t2->join();
  26.     t3->join();
  27.  
  28.     cout << ">>> exit" << endl;
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement