Top Banner
Tim Harris Researcher Microsoft Corporation
10

Tim Harris Researcher Microsoft Corporation. Source: Table from //.

Dec 16, 2015

Download

Documents

Jeffery Malone
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Tim Harris Researcher Microsoft Corporation. Source: Table from //.

Tim HarrisResearcherMicrosoft Corporation

Page 2: Tim Harris Researcher Microsoft Corporation. Source: Table from //.

Source: Table from http://www.intel.com/technology/mooreslaw/index.htm

1970

1980

1990

2000

2005

1,000

1,000,000

Transistor count1,000,000,000

4004

8086

Intel 486

Intel 386

286

IntelPentium

IntelPentium II

IntelPentium 4 Intel

Itanium 2

Increases in clock frequency

Increases in clock frequency

Increases in ILP

Increases in ILP

ParallelismParallelism

Page 3: Tim Harris Researcher Microsoft Corporation. Source: Table from //.

How do we find things to run in parallel?

How do we control sharing of data between concurrent threads?

Server workloads often provide a natural source of parallelism: Deal with

different clients concurrently

Server workloads often provide a natural source of parallelism: Deal with

different clients concurrently

Numerical workloads are, of course, also frequently parallelisable: Problems

can be partitioned, or parallel building blocks

composed

Numerical workloads are, of course, also frequently parallelisable: Problems

can be partitioned, or parallel building blocks

composed

Programmers aren’t good at thinking

about thread interleavings

Programmers aren’t good at thinking

about thread interleavings

…and locks provide a complicated solution

that discourages modularity

…and locks provide a complicated solution

that discourages modularity

Page 4: Tim Harris Researcher Microsoft Corporation. Source: Table from //.

Races: Due to forgotten locks Deadlock: Locks acquired in “wrong” order Lost wakeups: Forgotten notify to condition variableError recovery tricky: Need to restore invariants and release locks in exception handlersSimplicity versus scalability tensionLack of progress guarantees…but worst of all

Page 5: Tim Harris Researcher Microsoft Corporation. Source: Table from //.

Suppose we have a good concurrent hash table implementation:

void Swap(int kx, int ky) {vx = ht.Remove(kx);vy = ht.Remove(ky);ht.Insert(kx, vy);ht.Insert(ky, vx);

}

Page 6: Tim Harris Researcher Microsoft Corporation. Source: Table from //.

void Swap(int kx, int ky) {if (kx < ky) {

t = kx; kx = ky; ky = t;}ht.Lock(kx);ht.Lock(ky);vx = ht.Remove(kx);vy = ht.Remove(ky);ht.Insert(kx, vy);ht.Insert(ky, vx);ht.Unlock(kx);ht.Unlock(ky);

}

Page 7: Tim Harris Researcher Microsoft Corporation. Source: Table from //.

“Write the obvious sequential code and wrap ‘atomic’ around it”

void Swap(int kx, int ky) {atomic {

vx = ht.Remove(kx);vy = ht.Remove(ky);ht.Insert(kx, vy);ht.Insert(ky, vx);

}}

Page 8: Tim Harris Researcher Microsoft Corporation. Source: Table from //.

Integration with other language features (exceptions, finalizers, class initialization, ...)Integration with other parallel programming abstractions (locks/atomic, OpenMP, ...)Interaction with non-transacted resourcesCorrect usage and memory modelsPerformance analysis and tuningDebugging

Page 9: Tim Harris Researcher Microsoft Corporation. Source: Table from //.

© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after

the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Page 10: Tim Harris Researcher Microsoft Corporation. Source: Table from //.

Microsoft Research Faculty Summit 2007