mirror of
https://github.com/13hannes11/UU_la_parallel_programming_practical_assignments.git
synced 2024-09-04 00:50:58 +02:00
use TreiberStack in main function
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include <lib/ADT_Stack.h>
|
#include <lib/ADT_Stack.h>
|
||||||
#include <lib/Stack.cpp>
|
#include <lib/Stack.cpp>
|
||||||
#include <lib/SimpleLockingStack.h>
|
#include <lib/TreiberStack.h>
|
||||||
|
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
|
|
||||||
@@ -68,9 +68,10 @@ void run_worker(Stack* stack) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
done_mutex.lock();
|
done_mutex.lock();
|
||||||
|
std::cout << "Worker: done" << std::endl;
|
||||||
done_count ++;
|
done_count ++;
|
||||||
done_mutex.unlock();
|
done_mutex.unlock();
|
||||||
std::cout << "Worker: done" << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void run_checker() {
|
void run_checker() {
|
||||||
@@ -89,7 +90,7 @@ void run_checker() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
Stack * s = new SimpleLockingStack(op_queue);
|
Stack * s = new TreiberStack(op_queue);
|
||||||
|
|
||||||
std::thread *worker= new std::thread[THREADS];
|
std::thread *worker= new std::thread[THREADS];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user