Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Introduction to Transactional Memory
Sami Kiminki 2009-03-12
Sami Kiminki Introduction to Transactional Memory
Introduction to Transactional Memory Sami Kiminki 2009-03-12 Sami - - PowerPoint PPT Presentation
Introduction High-level programming with TM TM implementations TM in Sun Rock processor Introduction to Transactional Memory Sami Kiminki 2009-03-12 Sami Kiminki Introduction to Transactional Memory Introduction High-level programming with
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
// atomic map // // Implemented by i n h e r i t i n g std : : map and wrapping a l l // data manipulator methods i n t o t r a n s a c t i o n s #i n c l u d e <map > template<c l a s s key type , c l a s s mapped type> c l a s s atomic map : p u b l i c std : : map <key type , mapped type> { p u b l i c : std : : pair<typename atomic map : : i t e r a t o r , bool> i n s e r t ( const typename atomic map : : v a l u e t y p e &v ) { t r a n s a c t i o n { return std : : map <key type , mapped type >:: i n s e r t ( v ) ; } } . . . }; Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
#pragma omp p a r a l l e l f o r f o r ( i =0; i< N; i ++) { #pragma omp t r a n s a c t i o n { bin [A[ i ] ] = bin [A[ i ] ] + 1; } } #pragma omp t r a n s f o r s c h e d u l e ( s t a t i c , 42 , 6) f o r ( i =0; i< N; i ++) { bin [A[ i ] ] = bin [A[ i ] ] + 1 ; } #pragma omp t r a n s s e c t i o n s
{ #pragma omp t r a n s s e c t i o n WORK A( ) ; #pragma omp t r a n s s e c t i o n WORK B( ) ; }
Source: http://tcc.stanford.edu/publications/tcc_pact2007_talk.pdf
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Source: http://www.opensparc.net/pubs/preszo/08/RockHotChips.pdf
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
0.1 1 10 100 1 2 3 4 5 6 8 10 12 16
Throughput (ops/usec)
# Threads HashTable Test: keyrange=256, 0% lookups phtm phtm-tl2 hytm stm stm-tl2
0.1 1 10 100 1 2 3 4 5 6 8 10 12 16
Throughput (ops/usec)
# Threads HashTable Test: keyrange=128000, 0% lookups phtm phtm-tl2 hytm stm stm-tl2
(a) (b) Figure 1. HashTable with 50% inserts, 50% deletes: (a) key range 256 (b) key range 128,000.
Source: Dice et al: Early Experience with a Commercial Hardware Transactional Memory Implementation, ASPLOS’09. c Sun Microsoftems, Inc.
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
0.1 1 10 100 1 2 3 4 6 8 12 16
Throughput (ops/usec)
# Threads RedBlackTree: 100% reads, keyrange=[0,128) 0.1 1 10 100 1 2 3 4 6 8 12 16
Throughput (ops/usec)
# Threads RedBlackTree: 96% reads, keyrange=[0,2048) phtm phtm-tl2 hytm stm stm-tl2
(a) (b) Figure 2. Red-Black Tree. (a) 128 keys, 100% reads (b) 2048 keys, 96% reads, 2% inserts, 2% deletes.
Source: Dice et al: Early Experience with a Commercial Hardware Transactional Memory Implementation, ASPLOS’09. c Sun Microsoftems, Inc.
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
1 10 100 1 2 3 4 6 8 12 16
Throughput (ops/usec)
# Threads STLVector Test: initsiz=100, ctr-range=40 htm.oneLock noTM.oneLock htm.rwLock noTM.rwLock 1 10 100 1 2 3 4 6 8 12 16 Throughput (operations/us) # threads TLE with Hashtable in Java 0:10:0-locks 0:10:0-TLE 1:8:1-locks 1:8:1-TLE 2:6:2-locks 2:6:2-TLE 4:2:4-locks 4:2:4-TLE
(a) (b) Figure 3. (a) TLE in C++ with STL vector (b) TLE in Java with Hashtable.
Source: Dice et al: Early Experience with a Commercial Hardware Transactional Memory Implementation, ASPLOS’09. c Sun Microsoftems, Inc.
Sami Kiminki Introduction to Transactional Memory
Introduction High-level programming with TM TM implementations TM in Sun Rock processor
Sami Kiminki Introduction to Transactional Memory