Unnecessary yielding negates any performance advantage spinlocks have over critical sections, while insufficient yielding can occasionally cause drastic performance degradation if a thread is preempted while owning a spinlock.

解决方案 »

  1.   

    I encountered a problem while reading msdn on the line.
    Would you please do me a favor to have it translated into chinese?
    THX!
      

  2.   

    当进行同步的时候,原子函数比起临界区根本没有性能上的优势。
    For this reason, you should use critical sections instead.
      

  3.   

    OH!I C
    ((Unnecessary yielding) negates( (any performance advantage spinlocks have )over (critical sections))), while (((insufficient yielding)( can occasionally cause) (drastic performance degradation ))if (a thread is preempted while owning a spinlock).
    Thanks all the same!