
272
CHAPTER 9 SYNCHRONIZATION PERFORMANCE IMPACT AND GUIDELINES
argument on the command line. You can run it on your host processor to find a
good va lue for this particular test program on your SMP systems, as suggested in
Exercise 9–2.
Semaphore “Throttles” to Reduce Thread Contention
A large number of thread s contending for a single resource, such as a mutex or CS,
can degrade performance on both single- and multiple-processor systems.
Frequently, the negative performance i mpact can be minimized by spin counts,
careful use of the right synchronization objects, or restructuring of your program
to increase lock granularity and
locking times.
If