OpenMP Multithreading on a Random Password Generator
问题 I am attempting to make a fast password generator using multithreading with OpenMP integrated into Visual Studio 2010. Let's say I have this basic string generator that randomly pulls Chars from a string. srand(time(0)); for (i = 0; i < length; ++i) { s=pwArr[rand()%(pwArr.size()-1)]; pw+=s; } return pw; Now, the basic idea is to enable multithreading with OpenMP to enable really fast random char lookup, like so: srand(time(0)); #pragma omp parallel for for (i = 0; i < length; ++i) { s=pwArr