coins/ExecuteCoins.cpp
/**
 * @brief: Because executing std::thread requires a function to execute upon, this function was
 *           made so that in initializeMulti and initializePool could call upon it.
 *         mtx used so global variables can stay consistent and not deal with race conditions.
 *         sem_post signifies that execution has concluded and another thread can be created.
 */
@brief: Because executing std::thread requires a function to execute upon, this function was
made so that in initializeMulti and initializePool could call upon it.
mtx used so global variables can stay consistent and not deal with race conditions.
sem_post signifies that execution has concluded and another thread can be created.
@brief : Because executing std :: thread requires a function to execute upon this function was made so that in initializeMulti and initializePool could call upon it . mtx used so global variables can stay consistent and not deal with race conditions . sem_post signifies that execution has concluded and another thread can be created .
void execMulti(std::vector<int> arr, coin ans)
{
    auto startAlgo = std::chrono::high_resolution_clock::now();
    coin out = twelvecoins.exec(arr);
    auto stopAlgo = std::chrono::high_resolution_clock::now();
    auto duration = std::chrono::duration_cast<std::chrono::microseconds>(stopAlgo - startAlgo);
    bool correct = twelvecoins.validate(out,ans);
    mtx.lock();
    durationExec += duration;
    numCorrect += correct;
    sem_post(&sem);
    mtx.unlock();
    return;
}
void execMulti ( std :: vector < int > arr , coin ans ) { auto startAlgo = std :: chrono :: high_resolution_clock :: now ( ) ; coin out = twelvecoins . exec ( arr ) ; auto stopAlgo = std :: chrono :: high_resolution_clock :: now ( ) ; auto duration = std :: chrono :: duration_cast < std :: chrono :: microseconds > ( stopAlgo - startAlgo ) ; bool correct = twelvecoins . validate ( out , ans ) ; mtx . lock ( ) ; durationExec += duration ; numCorrect += correct ; sem_post ( & sem ) ; mtx . unlock ( ) ; return ; }
@brief: Because executing std::thread requires a function to execute upon, this function was
           made so that in initializeMulti and initializePool could call upon it.
@brief : Because executing std :: thread requires a function to execute upon this function was made so that in initializeMulti and initializePool could call upon it .