I am trying to modify Linux program to Visual Studio 2022 & CUDA Toolkit. What to replace the Linux pthread.h commands with to be able to compile the program?
These are the commands:
pthread_mutex_init()
pthread_mutex_lock()
pthread_create()
pthread_mutex_unlock()
Part of the main program:
pthread_mutex_init(&solutionLock, NULL);
pthread_mutex_lock(&solutionLock);
unsigned long** processedPtrs = (unsigned long**)malloc(sizeof(unsigned long*) * GPUS);
pthread_t* tids = (pthread_t*)malloc(sizeof(pthread_t) * GPUS);
long long start = timems();
for (int i = 0; i < GPUS; i++) {
HandlerInput* hi = (HandlerInput*)malloc(sizeof(HandlerInput));
hi->device = i;
hi->hashesProcessed = 0;
processedPtrs[i] = &hi->hashesProcessed;
pthread_create(tids + i, NULL, launchGPUHandlerThread, hi);
usleep(10);
}