[–] jjmanton 14y ago ↗ It is strange the article makes no mention of grand central dispatch. It makes threading easy even for the most inexperienced developer. [–] LinaLauneBaer 14y ago ↗ Or NSOperation/NSOperationQueue (which are using GCD under the hood).
[–] logancapaldo 14y ago ↗ This article is pretty terrifying: #import <pthread.h> #import <stdlib.h> // Globals pthread_mutex_t *gLck; int gSum; int main (int argc, const char * argv[]) { pthread_t *tFoo, *tBar; int tErr, tArgF, tArgB; // create the mutex construct tErr = pthread_mutex_init(gLck);
[–] pagekalisedown 14y ago ↗ I recommend using boost.thread. It's cross-platform, and simpler than pthread. [–] pagekalisedown 14y ago ↗ I should mention that the current boost.thread (v.1.49.0) doesn't provide a simple way to change the priority or scheduling of a thread.You have to do it thru the underlying system-specific handle obtained by boost::thread::native_handle().
[–] pagekalisedown 14y ago ↗ I should mention that the current boost.thread (v.1.49.0) doesn't provide a simple way to change the priority or scheduling of a thread.You have to do it thru the underlying system-specific handle obtained by boost::thread::native_handle().
5 comments
[ 3.3 ms ] story [ 20.0 ms ] threadYou have to do it thru the underlying system-specific handle obtained by boost::thread::native_handle().