1 / 10

Software Transactional Memory Panacea or Pandora’s Box?

Software Transactional Memory Panacea or Pandora’s Box?. Tim Harris Researcher Microsoft Corporation. Moore’s Law. Transistor count 1,000,000,000. Increases in clock frequency. Intel Pentium 4. Intel Itanium 2. Intel Pentium. 1,000,000. Intel Pentium II. Intel 486. 286. Parallelism.

colton
Download Presentation

Software Transactional Memory Panacea or Pandora’s Box?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Software Transactional MemoryPanacea or Pandora’s Box? Tim Harris Researcher Microsoft Corporation

  2. Moore’s Law Transistor count 1,000,000,000 Increases in clock frequency IntelPentium 4 IntelItanium 2 IntelPentium 1,000,000 IntelPentium II Intel 486 286 Parallelism Increases in ILP Intel 386 8086 1,000 4004 1970 1980 1990 2000 2005 Source: Table from http://www.intel.com/technology/mooreslaw/index.htm

  3. Using Parallel Hardware Is Hard • 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 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 …and locks provide a complicated solution that discourages modularity

  4. Problems With Locks And Cond-Vars • Races: Due to forgotten locks • Deadlock: Locks acquired in “wrong” order • Lost wakeups: Forgotten notify to condition variable • Error recovery tricky: Need to restore invariants and release locks in exception handlers • Simplicity versus scalability tension • Lack of progress guarantees • …but worst of all

  5. Locks Get In The Way Of Modularity • Suppose we have a good concurrent hash table implementation: void Swap(intkx, intky) { vx = ht.Remove(kx); vy = ht.Remove(ky); ht.Insert(kx, vy); ht.Insert(ky, vx); }

  6. Expose Per-Key LockingNow think about failures... void Swap(intkx, intky) { 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); }

  7. Atomic Blocks: Panacea • “Write the obvious sequential code and wrap ‘atomic’ around it” void Swap(intkx, intky) { atomic { vx = ht.Remove(kx); vy = ht.Remove(ky); ht.Insert(kx, vy); ht.Insert(ky, vx); } }

  8. Atomic Blocks: Pandora’s Box • Integration with other language features (exceptions, finalizers, class initialization, ...) • Integration with other parallel programming abstractions (locks/atomic, OpenMP, ...) • Interaction with non-transacted resources • Correct usage and memory models • Performance analysis and tuning • Debugging

  9. © 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.

More Related