[Bf-committers] Curious about 'SetThreadGroupAffinity()'

John Emmas john at creativepost.co.uk
Mon May 28 12:15:09 CEST 2018

Hi guys - forgive me asking a trivial question.  It's just something I 
noticed in the Blender code...

I'm involved mostly in audio products where we often use multiple 
threads to run things like the processing stuff (plugins etc).  On 
Windows we'll call functions like 'SetThreadAffinityMask()' or 
'SetThreadIdealProcessor()' to ensure that multiple threads get run on 
different CPU cores which gives an element of parallel processing 
(assuming there's enough cores available).

But looking through the Blender code it seems like you've chosen a 
different approach ('SetThreadGroupAffinity()').  I might be 
misunderstanding something but AFAICT that'll assign threads to a 
processor group (rather than any individual processor).  So it won't 
necessarily promote parallel processing.  Or isn't that the reason?  Do 
you use that approach because it offers some other benefit?  Like I 
said, I'm just curious really...


More information about the Bf-committers mailing list