News for hackers. Stuff that matters.
Re:Mastering Threads on MacOS X by logancapaldo on Sunday March 18, 2012 @01:50PM (#3720262)
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);
Re:Mastering Threads on MacOS X by jjmanton on Sunday March 18, 2012 @01:46PM (#3720248)
It is strange the article makes no mention of grand central dispatch. It makes threading easy even for the most inexperienced developer.
Re:Mastering Threads on MacOS X by LinaLauneBaer on Sunday March 18, 2012 @02:27PM (#3720381)
Or NSOperation/NSOperationQueue (which are using GCD under the hood).
Re:Mastering Threads on MacOS X by pagekalisedown on Sunday March 18, 2012 @02:43PM (#3720456)
I recommend using boost.thread. It's cross-platform, and simpler than pthread.
Re:Mastering Threads on MacOS X by pagekalisedown on Sunday March 18, 2012 @06:57PM (#3721310)
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().