Question: Is this a single process? Are there multiple address spaces being used within the process(es)? What is different about each thread if anything? What exactly
Is this a single process? Are there multiple address spaces being used within the process(es)? What is different about each thread if anything? What exactly is it doing and the expected output. //CSC313 Operating Systems
#include
using namespace std;
int addthreads = 0;
void squarenum(int x) {
addthreads += x * x * x;
}
int main() {
vector
for (int i = 1; i <= 6; i++){
septhread.push_back(thread(&squarenum, i));
}
for (auto& th : septhread){
th.join();
}
cout << "Your answer = " << addthreads << endl;
system("pause");
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
