FILL IN BARRIER.H AND BARRIER.CPP AS WELL AS INCLUDE THE
SEMAPHORE PART IN THE INSTRUCTIONS. PLEASE WRITE ALL PROGRAMS IN
C++
Barrier.h
Barrier,cpp
prefix-sum.cpp
#ifndef BARRIER_H #define BARRIER_H #include <semaphore.h> namespace synchronization { // Provides a reusable barrier class barrier { private: // Declare your variables here public: // Constructor barrier(int numberOfThreads ); // Destructor ~barrier(); // Function to wait at the barrier until all threads have reached the barrier void arriveAndWait ( void ); }; } #endif
#include "barrier.h" namespace synchronization { barrier::barrier(int numberOfThreads ) { // Write your code here return; } barrier::~barrier() { } // Write your code here return; } void barrier::arriveAndWait(void) { // Write your code here return;
FILL IN BARRIER.H AND BARRIER.CPP AS WELL AS INCLUDE THE SEMAPHORE PART IN THE INSTRUCTIONS. PLEASE WRITE ALL PROGRAMS I
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am