FILL IN BARRIER.H AND BARRIER.CPP AS WELL AS INCLUDE THE SEMAPHORE PART IN THE INSTRUCTIONS. PLEASE WRITE ALL PROGRAMS I
Posted: Thu May 05, 2022 1:02 pm
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;
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;