[Development] Mutex future directions

Carsten Breuer CarstenBreuerQt at textwork.de
Wed May 23 23:44:57 CEST 2012


Hi Thiago,

thanks for clearing this :-)

>> I guess it depends a bit on if you want to yield to another thread or
>> not ;-). Of course: burning cpu time is another way to solve this ;-)
> 
> According to the Intel manual, if you *don't* yield and you don't have the 
> PAUSE instruction, you may make things worse. 

What do you exactly mean with a PAUSE instruction. Is this a assembler
processor command?

> For one thing, if you don't yield, the processor will continue executing your 
> code, without giving a chance for other processes to run. There's no guarantee 
> even in a multiprocessor system that the other thread is running. And even if 
> it's running, if it was scheduled to another thread on the same hyperthreaded 
> core, the processor may not execute the that thread because this thread still 
> has instructions to execute.

Interesting. Wouldn't it be better to change YieldCurrentThread?
I guess, most of us are not aware of this and some of us
learned in the 386 century that give back CPU performance to the OS is
always a good thing. I guess it is even nowadays a good thing on single
core machines. Isn't it?

Thanks and Best Regards,



Carsten



More information about the Development mailing list