Upcoming SlideShare
×

1,877 views

Published on

Published in: Education, Technology
1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
1,877
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
133
0
Likes
1
Embeds 0
No embeds

No notes for slide

5. 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