Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma omp parallel for
- for (i=0; i < numPixels; i++)
- {
- pGrayScaleBitmap[i] = (unsigned BYTE)
- (pRGBBitmap[i].red * 0.299 +
- pRGBBitmap[i].green * 0.587 +
- pRGBBitmap[i].blue * 0.114);
- }
- * pthread_create, pthread_detach.
- * pthread_mutexattr_init, pthread_mutexattr_settype, pthread_mutex_init,
- * pthread_mutexattr_destroy, pthread_mutex_destroy, pthread_mutex_lock,
- * pthread_mutex_trylock, pthread_mutex_unlock, pthread_mutex_timedlock.
- * sem_init, sem_destroy, sem_post, sem_wait, sem_trywait, sem_timedwait.
- /*ThreadA:*/ while(1){ mutex.lock(); printf("an"); usleep(100000); mutex.unlock(); }
- /*ThreadB:*/ while(1){ mutex.lock(); printf("bn"); usleep(100000); mutex.unlock(); }
- #pragma omp parallel for
- for (i=0; i < numPixels; i++)
- { ...}
- parallel_for(0,numPixels,1,ToGrayScale());
- parallel_for(0,numPixels,1,[&](int i)
- {
- pGrayScaleBitmap[i] = (unsigned BYTE)
- (pRGBBitmap[i].red * 0.299 +
- pRGBBitmap[i].green * 0.587 +
- pRGBBitmap[i].blue * 0.114);
- });
Add Comment
Please, Sign In to add comment