13.07.2015 Views

Intel® 64 and IA-32 Architectures Optimization Reference Manual

Intel® 64 and IA-32 Architectures Optimization Reference Manual

Intel® 64 and IA-32 Architectures Optimization Reference Manual

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

MULTICORE AND HYPER-THREADING TECHNOLOGYmore efficient than other more complicated synchronization primitives withhigher overhead.For more information on using different synchronization primitives, see thewhite paper Developing Multi-threaded Applications: A Platform ConsistentApproach. See http://www3.intel.com/cd/ids/developer/asmona/eng/53797.htm.• When choosing between different primitives to implement a synchronizationconstruct, using Intel Thread Checker <strong>and</strong> Thread Profiler can be very useful indealing with multithreading functional correctness issue <strong>and</strong> performance impactunder multi-threaded execution. Additional information on the capabilities ofIntel Thread Checker <strong>and</strong> Thread Profiler are described in Appendix A.Table 8-1 is useful for comparing the properties of three categories of synchronizationobjects available to multi-threaded applications.CharacteristicsCycles to acquire<strong>and</strong> release (ifthere is acontention)PowerconsumptionScheduling <strong>and</strong>contextswitchingTable 8-1. Properties of Synchronization ObjectsOperating SystemSynchronization ObjectsThous<strong>and</strong>s or Tens ofthous<strong>and</strong>s cyclesSaves power by halting thecore or logical processor ifidleReturns to the OS schedulerif contention exists (can betuned with earlier spin loopcount)Light Weight UserSynchronizationHundreds of cyclesSome power saving ifusing PAUSEDoes not return to OSscheduler voluntarilySynchronizationObject based onMONITOR/MWAITHundreds of cyclesSaves more powerthan PAUSEDoes not return to OSscheduler voluntarilyRing level Ring 0 Ring 3 Ring 0Miscellaneous Some objects provide intraprocessMust lock accesses to Same as light weight.synchronization <strong>and</strong> synchronizationCan be used only onsome are for inter-process variable if severalsystems supportingcommunicationthreads may write to itMONITOR/MWAITsimultaneously.Otherwise can writewithout locks.8-15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!