Upcoming SlideShare
×

• 1,498 views

More in: Education , Technology
• Comment goes here.
Are you sure you want to
Be the first to comment

Total Views
1,498
On Slideshare
0
From Embeds
0
Number of Embeds
0

Shares
123
0
Likes
1

No embeds

### Report content

No notes for slide

### Transcript

• 5. Multicore Programming Latency and Throughput Multicore systems putting pressure on programmers, challenges include Latency: time to complete an operation Dividing activities Throughput: work completed per unit time. Balance Data splitting Data dependency Testing and debuggingOperating System Concepts – 8th Edition 4.17 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8th Edition 4.19 Silberschatz, Galvin and Gagne ©2009 How Can it Help? Relationship between Latency and Throughput How can this code take advantage of 2 threads? Latency and bandwidth only loosely coupled for(k = 0; k < n; k++) Henry Ford: assembly lines increase bandwidth without reducing latency a[k] = b[k] * c[k] + d[k] * e[k]; My factory takes 1 day to make a Model-T Ford. Rewrite this code fragment as: But I can start building a new car every 10 minutes do_mult(l, m) { At 24 hrs/day, I can make 24 * 6 = 144 cars per day for(k = l; k < m; k++) A special order for 1 green car, still takes 1 day a[k] = b[k] * c[k] + d[k] * e[k]; Throughput is increased, but latency is not. } Latency reduction is difficult main() { Often, one can buy bandwidth CreateThread(do_mult, 0, n/2); E.g., more memory chips, more disks, more computers CreateThread(do_mult, n/2, n); Big server farms (e.g., google) are high bandwidthOperating System Concepts – 8th Edition 4.18 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8th Edition 4.20 Silberschatz, Galvin and Gagne ©2009