Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

How to use many core CPUs

604 views

Published on

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

How to use many core CPUs

  1. 1. How to use Many-core CPUs Roundtable: Google, Intel, Rambler, Yandex
  2. 2. Threads <ul><li>Hard to program: </li><ul><li>Correctness
  3. 3. Performance </li></ul><li>Unavoidable: 8 or 16 cores is commodity
  4. 4. Alternatives: </li><ul><li>Message passing – slow
  5. 5. Shared memory – even harder, usually no benefits </li></ul></ul>
  6. 6. Correctness <ul><li>Deadlocks </li><ul><li>C++: custom Mutex w/ builtin deadlock detector
  7. 7. C++: static analysis (gcc plugin, opensourse)
  8. 8. Java: run-time detector </li></ul><li>Races </li><ul><li>C++: run-time detector: ThreadSanitizer (Valgrind) </li><ul><li>Linux, Windows, Mac; opensource </li></ul><li>Java: ThreadSanitizer (beta) </li></ul></ul>
  9. 9. Performance <ul><li>Contension (threads compete for shared resource) </li><ul><li>Custom Mutex w/ contention profiling and web interface </li></ul><li>Cache locality (no ping-ponging between threads) </li><ul><li>Custom malloc (TCMalloc, opensource) </li></ul><li>Profiling : mostly PMU-based </li><ul><li>Oprofile, perfmon, google perf tools (opensource) </li></ul></ul>

×