Working (in terms of the run time) with a small program, for example, a c++ program can be easy even I have a few cores on my computer.
#include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int> g1;
for (int i = 1; i <= 10; i++)
g1.push_back(i * 10);
for (int i = 1; i <= 10; i++){
std::cout << g1[i] <<endl;
}
return 0;
}
But, I'm going to work with a program that has a very big vector size [more than a milions]. There are a lot of other processes as well, which makes it harder to finish the program on my computer(MacBook) with small run time. Is there any way that I can do it parallelly (i mean with multiple threads)? This means I run the same program, but the time gets reduced because of the processing in multiple threads. I'm very new to parallel computing, so let me know if the question is not clear enough.
The memory of my computer(macbook): [8GB 1600 MHz DDR3]
Processor: 1.6 GHz Dual-Core Intel Core i5