Csound Csound-dev Csound-tekno Search About

[Cs-dev] Thread affinity for OpenMP on Windows

Date2010-08-19 15:47
FromMichael Gogins
Subject[Cs-dev] Thread affinity for OpenMP on Windows
#include 
 #include 
 // Set OpenMP thread affinity
 void set_thread_affinity () {
     #pragma omp parallel default(shared)
     {
     DWORD_PTR mask = (1 << omp_get_thread_num());
     SetThreadAffinityMask( GetCurrentThread(), mask );
     }
 }

-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net