mirror of
https://github.com/13hannes11/UU_la_parallel_programming_practical_assignments.git
synced 2024-09-04 00:50:58 +02:00
add run worker method
This commit is contained in:
@@ -43,14 +43,25 @@ std::vector<operation> generate_operations_uniform(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//void run_worker(std::vector<operation>* operations, Set* set) {
|
void run_worker(std::vector<operation>* operations, Stack* stack) {
|
||||||
// DEBUG_MSG("Run worker");
|
std::cout << "Worker: start" << std::endl;
|
||||||
// long op_counter = 0;
|
long op_counter = 0;
|
||||||
// for (operation op : operations) {
|
for (operation op : *operations) {
|
||||||
/* code */
|
switch (op.method) {
|
||||||
// do_operation(&op, set);
|
case methodname::pop:
|
||||||
// }
|
stack->pop();
|
||||||
//}
|
break;
|
||||||
|
case methodname::push:
|
||||||
|
stack->push(op.value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
stack->size();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << "Worker: done" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
void run_checker(ADTOperationQueue queue, int* done_count) {
|
void run_checker(ADTOperationQueue queue, int* done_count) {
|
||||||
ADTStack * adt_stack = new ADTStack();
|
ADTStack * adt_stack = new ADTStack();
|
||||||
|
|||||||
Reference in New Issue
Block a user