Intel ARCHITECTURE IA-32 User Manual Page 356

  • Download
  • Add to my manuals
  • Print
  • Page
    / 568
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 355
IA-32 Intel® Architecture Optimization
7-10
Producer-Consumer Threading Models
Figure 7-3 illustrates the basic scheme of interaction between a pair of
producer and consumer threads. The horizontal direction represents
time. Each block represents a task unit, processing the buffer assigned to
a thread. The gap between each task represents synchronization
overhead. The decimal number in the parenthesis represents a buffer
index. On an Intel Core Duo processor, the producer thread can store
data in the second-level cache to allow the consumer thread to continue
work requiring minimal bus traffic.
The basic structure to implement the producer and consumer thread
functions with synchronization to communicate buffer index is shown in
Example 7-2.
Figure 7-3 Execution of Producer-consumer Threading Model on a Multi-core
Processor
Main
Thread
P(2) P(1)P(2)P(1)
C(1)C(2)C(1) C(2)
P(1)
P: producer
C: consumer
Page view 355
1 2 ... 351 352 353 354 355 356 357 358 359 360 361 ... 567 568

Comments to this Manuals

No comments