Can't you use semaphores to make it portable? maybe I do not understand the problem.mcostalba wrote:FromHoudini wrote:In Windows there's the function YieldProcessor() - maybe this only works in Visual Studio.mcostalba wrote:BTW I have given a quick lookat Crafty code but the "pause" solution does not seem portable to me becuase is coded in an asm{} gcc-ism statement that does not work under Windows....
Robert
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
I am not sure is an equivalent solution, becuase it seems if HT is off then threads keep spinning....at least reading the docs it seems like this to me.Code: Select all
YieldProcessor Macro Signals to the processor to give resources to threads that are waiting for them. This macro is only effective on processors that support technology allowing multiple threads running on a single processor, such as Intel's Hyperthreading technology.
Miguel