Chapter 4: Threads Outline Wh a t a r e t h r e a d s - - PowerPoint PPT Presentation

chapter 4 threads outline
SMART_READER_LITE
LIVE PREVIEW

Chapter 4: Threads Outline Wh a t a r e t h r e a d s - - PowerPoint PPT Presentation

Chapter 4: Threads Outline Wh a t a r e t h r e a d s ? H o w d o t h e y c o m p a r e w i t h p r o c e s s e s ? Wh y a r e t h r e a d s i m p o r t a n t ? Wh a t


slide-1
SLIDE 1

Chapter 4: Threads – Outline

 Wh

a t a r e t h r e a d s ? H

  • w

d

  • t

h e y c

  • m

p a r e w i t h p r

  • c

e s s e s ?

 Wh

y a r e t h r e a d s i m p

  • r

t a n t ?

 Wh

a t a r e t h e c

  • m

m

  • n

m u l t i t h r e a d i n g m

  • d

e l s ?

 Wh

a t a r e t h e c

  • m

m

  • n

m u l t i t h r e a d i n g l i b r a r i e s ?

 D

i s c u s s i

  • n
  • n

t h r e a d i n g i s s u e s .

 E

x a m p l e s

  • f

t h r e a d s i n c

  • n

t e m p

  • r

a r y O S e s .

slide-2
SLIDE 2

Process Overview

 T

h e b a s i c u n i t

  • f

C P U u t i l i z a t i

  • n

i s a p r

  • c

e s s .

 T

  • r

u n a p r

  • g

r a m ( a s e q u e n c e

  • f

i n s t r u c t i

  • n

s ) , c r e a t e a p r

  • c

e s s .

 P

r

  • c

e s s p r

  • p

e r t i e s

 fork() → exec()

c a n b e u s e d t

  • s

t a r t n e w p r

  • g

r a m e x e c u t i

  • n

 p

r

  • c

e s s e s a r e w e l l p r

  • t

e c t e d f r

  • m

e a c h

  • t

h e r

 c

  • n

t e x t

  • s

w i t c h i n g b e t w e e n p r

  • c

e s s e s i s f a i r l y e x p e n s i v e

 i

n t e r

  • p

r

  • c

e s s c

  • m

m u n i c a t i

  • n

u s e d f

  • r

i n f

  • r

m a t i

  • n

s h a r i n g a n d c

  • r

d i n a t i

  • n

b e t w e e n p r

  • c

e s s e s

 s

h a r e d m e m

  • r

y

 m

e s s a g e p a s s i n g

slide-3
SLIDE 3

Is the Process Abstraction Always Suitable ?

 C

  • n

s i d e r c h a r a c t e r i s t i c s f

  • r

a g a m e s

  • f

t w a r e

 d

i fg e r e n t c

  • d

e s e q u e n c e s f

  • r

d i fg e r e n t g a m e

  • b

j e c t s

 s

  • l

d i e r s , c i t i e s , a i r p l a n e s , c a n n

  • n

s , u s e r

  • c
  • n

t r

  • l

l e d h e r

  • e

s , e t c .

 e

a c h

  • b

j e c t i s m

  • r

e

  • r

l e s s i n d e p e n d e n t

 P

r

  • b

l e m s

 s

i n g l e m

  • n
  • l

i t h i c p r

  • c

e s s m a y n

  • t

u t i l i z e r e s

  • u

r c e s

  • p

t i m a l l y

 c

a n c r e a t e a p r

  • c

e s s f

  • r

e a c h

  • b

j e c t

 a

c t i

  • n
  • f

a n

  • b

j e c t d e p e n d s

  • n

g a m e s t a t e

 s

h a r i n g a n d c

  • r

d i n a t i

  • n
  • f

i n f

  • r

m a t i

  • n

n e c e s s a r y

 I

P C i s e x p e n s i v e

 n

u m b e r

  • f
  • b

j e c t s p r

  • c

e e d s i m u l t a n e

  • u

s l y

 m

a y i n v

  • l

v e l

  • t

s

  • f

c

  • n

t e x t s w i t c h e s

 p

r

  • c

e s s c

  • n

t e x t s w i t c h e s a r e e x p e n s i v e

slide-4
SLIDE 4

Is the Process Abstraction Always Suitable ? (2)

 A

b i l i t y t

  • r

u n m u l t i p l e s e q u e n c e s

  • f

c

  • d

e ( t h r e a d s

  • f

c

  • n

t r

  • l

) f

  • r

d i fg e r e n t

  • b

j e c t

 i

n d i v i d u a l p r

  • c

e s s

  • n

l y

  • fg

e r s

  • n

e t h r e a d

  • f

c

  • n

t r

  • l

 Wa

y f

  • r

t h r e a d s

  • f

c

  • n

t r

  • l

t

  • s

h a r e d a t a e fg e c t i v e l y

 p

r

  • c

e s s e s N O T d e s i g n e d t

  • d
  • t

h i s

 P

r

  • t

e c t i

  • n

b e t w e e n t h r e a d s

  • f

c

  • n

t r

  • l

n

  • t

v e r y i m p

  • r

t a n t

 a

l l i n

  • n

e a p p l i c a t i

  • n

, a n y w a y !

 p

r

  • c

e s s i s a n

  • v

e r

  • k

i l l

 S

w i t c h i n g b e t w e e n t h r e a d s

  • f

c

  • n

t r

  • l

m u s t b e e ffj c i e n t

 c

  • n

t e x t s w i t c h i n g i n v

  • l

v e s a l

  • t
  • f
  • v

e r h e a d

 D

i fg e r e n t t h r e a d s

  • f

c

  • n

t r

  • l

m a y s h a r e m

  • s

t i n f

  • r

m a t i

  • n

 p

r

  • c

e s s e s d u p l i c a t e e n t i r e a d d r e s s s p a c e

slide-5
SLIDE 5

Threads to the Rescue

 T

h r e a d s a r e d e s i g n e d t

  • a

c h i e v e a l l t h e a b

  • v

e r e q u i r e m e n t s !

 d

  • a

s l i t t l e a s p

  • s

s i b l e t

  • a

l l

  • w

e x e c u t i

  • n
  • f

a t h r e a d

  • f

c

  • n

t r

  • l

 T

h r e a d a r e k n

  • w

n a s a l i g h t w e i g h t p r

  • c

e s s

 o

n l y t h e n e c e s s a r y c

  • n

t e x t i n f

  • r

m a t i

  • n

i s r e

  • g

e n e r a t e d

 t

h r e a d

  • c
  • n

t e x t : P C , r e g i s t e r s , s t a c k ,

  • t

h e r m i s c . i n f

  •  p

r

  • c

e s s

  • c
  • n

t e x t : a l s

  • i

n c l u d e s d a t a a n d c

  • d

e r e g i

  • n

s

 t

h r e a d s a r e e x e c u t e d w i t h i n a p r

  • c

e s s

 c

  • d

e a n d d a t a s h a r e d a m

  • n

g d i fg e r e n t t h r e a d s

 r

e d u c e d c

  • m

m u n i c a t i

  • n
  • v

e r h e a d

 s

m a l l e r c

  • n

t e x t

 f

a s t e r c

  • n

t e x t s w i t c h i n g

 a

s i n g l e a d d r e s s s p a c e f

  • r

a l l t h r e a d s i n a p r

  • c

e s s

 r

e d u c e d i n t e r

  • t

h r e a d p r

  • t

e c t i

  • n
slide-6
SLIDE 6

Thread Basics

 T

h r e a d – a l i g h t w e i g h t p r

  • c

e s s

 h

a v e t h e i r

  • w

n i n d e p e n d e n t fm

  • w
  • f

c

  • n

t r

  • l

 s

h a r e p r

  • c

e s s r e s

  • u

r c e s w i t h

  • t

h e r s i b l i n g t h r e a d s

 e

x i s t w i t h i n t h e c

  • n

t e x t s p a c e

  • f

t h e s a m e p r

  • c

e s s

 T

h r e a d s s h a r e d d a t a

 p

r

  • c

e s s i n s t r u c t i

  • n

s

 m

  • s

t d a t a

 o

p e n fj l e s ( d e s c r i p t

  • r

s )

 s

i g n a l s a n d s i g n a l h a n d l e r s

 c

u r r e n t w

  • r

k i n g d i r e c t

  • r

y

 u

s e r a n d g r

  • u

p i d

 T

h r e a d s s p e c i fj c d a t a

 t

h r e a d i d

 r

e g i s t e r s , s t a c k p

  • i

n t e r

 t

h r e a d

  • s

p e c i fj c d a t a ( s t a c k

  • f

a c t i v a t i

  • n

r e c

  • r

d s )

 s

i g n a l m a s k

 s

c h e d u l i n g p r

  • p

e r t i e s

 r

e t u r n v a l u e

slide-7
SLIDE 7

Single and Multithreaded Process

source: https://computing.llnl.gov/tutorials/pthreads/

slide-8
SLIDE 8

Thread Benefits

 R

e s p

  • n

s i v e n e s s

 f

  • r

a n i n t e r a c t i v e u s e r , i f p a r t

  • f

t h e a p p l i c a t i

  • n

i s b l

  • c

k e d

 R

e s

  • u

r c e S h a r i n g

 e

a s i e r , v i a m e m

  • r

y s h a r i n g

 b

e a w a r e

  • f

s y n c h r

  • n

i z a t i

  • n

i s s u e s

 E

c

  • n
  • m

y

 s

h a r i n g r e d u c e s c r e a t i

  • n

, c

  • n

t e x t

  • s

w i t c h i n g , a n d s p a c e

  • v

e r h e a d

 S

c a l a b i l i t y

 c

a n e x p l

  • i

t c

  • m

p u t a t i

  • n

a l r e s

  • u

r c e s

  • f

a m u l t i c

  • r

e C P U

slide-9
SLIDE 9

Thread Programming In Linux

 T

h r e a d s c a n b e c r e a t e d u s i n g t h e P t h r e a d s l i b r a r y

 I

E E E P O S I X C l a n g u a g e t h r e a d p r

  • g

r a m m i n g i n t e r f a c e

 m

a y b e p r

  • v

i d e d e i t h e r a s u s e r

  • l

e v e l

  • r

k e r n e l

  • l

e v e l

 P

t h r e a d s A P I

 T

h r e a d m a n a g e m e n t – f u n c t i

  • n

s t

  • c

r e a t e , d e s t r

  • y

, d e t a c h , j

  • i

n , s e t / q u e r y t h r e a d a t t r i b u t e s

 M

u t e x e s – f u n c t i

  • n

s t

  • e

n f

  • r

c e s y n c h r

  • n

i z a t i

  • n

. C r e a t e , d e s t r

  • y

, l

  • c

k , u n l

  • c

k m u t e x e s

 C

  • n

d i t i

  • n

v a r i a b l e s – f u n c t i

  • n

s t

  • m

a n a g e t h r e a d c

  • m

m u n i c a t i

  • n

. C r e a t e , d e s t r

  • y

, w a i t a n d s i g n a l b a s e d

  • n

s p e c i fj e d v a r i a b l e v a l u e s

slide-10
SLIDE 10

Pthreads Example

#include <pthread.h> #include <stdio.h> int sum; /* data shared by all threads */ void runner(void param); /* thread function prototype */ int main (int argc, char *argv[]) { pthread_t tid; /* thread identifier */ pthread_attr_t attr /* set of thread attributes */ if(atoi(argv[1]) < 0) { fprintf(stderr, “%d must be >=0\n”, atoi(argv[1])); return -1; } /* get the default thread attributes */ pthread_attr_init(&attr); /* create the thread */ pthread_create(&tid, &attr, runner, argv[1]); /* wait for the thread to exit */ pthread_join(tid, NULL); fprintf(stdout, “sum = %d\n”, sum); }

slide-11
SLIDE 11

Pthreads Example (2)

.... (cont. from previous page...) /* The thread will begin control in this function */ void *runner (void *param) { int i, upper = atoi(param); sum = 0; for(i=1 ; i<=upper ; i++) sum += i; pthread_exit(0); }

slide-12
SLIDE 12

Pthread Example – API Calls

 p

t h r e a d _ a t t r _ i n i t – i n i t i a l i z e t h e t h r e a d a t t r i b u t e s

  • b

j e c t

 int pthread_attr_init(pthread_attr_t *attr);  d

e fj n e s t h e a t t r i b u t e s

  • f

t h e t h r e a d c r e a t e d

 p

t h r e a d _ c r e a t e – c r e a t e a n e w t h r e a d

 int pthread_create(pthread_t *restrict thread, const

pthread_attr_t *restrict attr, void *(*start_routine)(void*), void *restrict arg);

 upon success, a new thread id is returned in thread

 pthread_join – wait for thread to exit

 int pthread_join(pthread_t thread, void **value_ptr);  calling process blocks until thread exits

 pthread_exit – terminate the calling thread

 void pthread_exit(void *value_ptr);  make return value available to the joining thread

slide-13
SLIDE 13

User Vs. Kernel Level Threads

 U

s e r

  • l

e v e l t h r e a d s – m a n a g e t h r e a d s i n u s e r c

  • d

e

 a

d v a n t a g e s – e ffj c i e n t a n d fm e x i b l e i n s p a c e , s p e e d , s w i t c h i n g , a n d s c h e d u l i n g

 d

i s a d v a n t a g e s –

  • n

e t h r e a d b l

  • c

k e d

  • n

I / O c a n b l

  • c

k a l l t h r e a d s , d i ffj c u l t t

  • a

u t

  • m

a t i c a l l y t a k e a d v a n t a g e

  • f

S M P

 e

x a m p l e s

  • f

t h r e a d l i b r a r i e s – P O S I X P t h r e a d s , Wi n d

  • w

s t h r e a d s , J a v a T h r e a d s , G N U p

  • r

t a b l e T h r e a d s

 K

e r n e l

  • l

e v e l t h r e a d s – k e r n e l m a n a g e s t h e t h r e a d s

 A

d v a n t a g e s – r e m

  • v

e s d i s a d v a n t a g e s

  • f

u s e r

  • l

e v e l t h r e a d s

 D

i s a d v a n t a g e s – g r e a t e r

  • v

e r h e a d d u e t

  • k

e r n e l i n v

  • l

v e m e n t

 E

x a m p l e s – p r

  • v

i d e d b y a l m

  • s

t a l l G P O S

 Wi

n d

  • w

s , S

  • l

a r i s , L i n u x , M a c O S , e t c .

slide-14
SLIDE 14

Multithreading Models

 R

e l a t i

  • n

s h i p s b e t w e e n u s e r a n d k e r n e l t h r e a d s

 M

a n y

  • t
  • O

n e

 O

n e

  • t
  • O

n e

 M

a n y

  • t
  • M

a n y

slide-15
SLIDE 15

Many–to–One Multithreading Model

 M

a n y u s e r

  • l

e v e l t h r e a d s m a p p e d t

  • s

i n g l e k e r n e l t h r e a d

 e

x a m p l e s – S

  • l

a r i s G r e e n T h r e a d s , G N U P

  • r

t a b l e T h r e a d s

slide-16
SLIDE 16

One–to–One Multithreading Model

 E

a c h u s e r

  • l

e v e l t h r e a d m a p s t

  • k

e r n e l t h r e a d

 e

x a m p l e s – Wi n d

  • w

s N T / X P / 2 , L i n u x , S

  • l

a r i s 9 a n d l a t e r

slide-17
SLIDE 17

Many–to–Many Multithreading Model

 m

u s e r l e v e l t h r e a d s m a p p e d t

  • n

k e r n e l t h r e a d s

 o

p e r a t i n g s y s t e m c a n c r e a t e a s u ffj c i e n t n u m b e r

  • f

k e r n e l t h r e a d s

 e

x a m p l e s – S

  • l

a r i s p r i

  • r

t

  • v

9 , Wi n d

  • w

s N T / 2 T h r e a d F i b e r p a c k a g e

slide-18
SLIDE 18

Two-level Multithreading Model

 S

i m i l a r t

  • M

: M , e x c e p t t h a t i t a l s

  • a

l l

  • w

s a u s e r t h r e a d t

  • b

e b

  • u

n d t

  • k

e r n e l t h r e a d

 e

x a m p l e s – I R I X , H P

  • U

X , T r u 6 4 U N I X , S

  • l

a r i s 8 a n d e a r l i e r

slide-19
SLIDE 19

Threading Issues

 S

e m a n t i c s

  • f

f

  • r

k ( ) a n d e x e c ( ) s y s t e m c a l l s

 T

h r e a d c a n c e l l a t i

  • n
  • f

t a r g e t t h r e a d

 S

i g n a l h a n d l i n g

 I

m p l i c i t T h r e a d i n g

 T

h r e a d

  • s

p e c i fj c d a t a

 S

c h e d u l e r a c t i v a t i

  • n

s

slide-20
SLIDE 20

Semantics of fork() and exec()

 D

  • e

s f

  • r

k ( ) d u p l i c a t e

  • n

l y t h e c a l l i n g t h r e a d

  • r

a l l t h r e a d s ?

 s

  • m

e s y s t e m s p r

  • v

i d e t w

  • v

e r s i

  • n

s

  • f

f

  • r

k ( )

 H

  • w

a b

  • u

t e x e c ( ) ?

 m

  • s

t s y s t e m s m a i n t a i n t h e s e m a n t i c s

  • f

e x e c ( )

 O

b s e r v a t i

  • n

s

 e

x e c ( ) c a l l e d i m m e d i a t e l y a f t e r f

  • r

k

 d

u p l i c a t i n g a l l t h r e a d s i s u n n e c e s s a r y

 e

x e c ( ) n

  • t

c a l l e d a f t e r f

  • r

k

 n

e w p r

  • c

e s s s h

  • u

l d d u p l i c a t e a l l t h r e a d s

slide-21
SLIDE 21

Thread Cancellation

 T

e r m i n a t i n g a t h r e a d b e f

  • r

e i t h a s fj n i s h e d

 A

s y n c h r

  • n
  • u

s c a n c e l l a t i

  • n

 t

e r m i n a t e s t h e t a r g e t t h r e a d i m m e d i a t e l y

 a

l l

  • c

a t e d r e s

  • u

r c e s m a y n

  • t

a l l b e f r e e d e a s i l y

 s

t a t u s

  • f

s h a r e d d a t a m a y r e m a i n i l l

  • d

e fj n e d

 D

e f e r r e d c a n c e l l a t i

  • n

 t

a r g e t t h r e a d t e r m i n a t e s i t s e l f

 o

r d e r l y c a n c e l l a t i

  • n

c a n b e e a s i l y a c h i e v e d

 f

a i l u r e t

  • c

h e c k c a n c e l l a t i

  • n

s t a t u s m a y c a u s e i s s u e s

slide-22
SLIDE 22

Signal Handling

 S

i g n a l s a r e u s e d i n U N I X s y s t e m s t

  • n
  • t

i f y a p r

  • c

e s s t h a t a p a r t i c u l a r e v e n t h a s

  • c

c u r r e d

 A

s i g n a l h a n d l e r i s u s e d t

  • p

r

  • c

e s s s i g n a l s

 O

S m a y d e l i v e r t h e s i g n a l t

  • t

h e a p p r

  • p

r i a t e p r

  • c

e s s

 O

S

  • r

p r

  • c

e s s h a n d l e s t h e s i g n a l

 T

y p e s

  • f

s i g n a l s

 s

y n c h r

  • n
  • u

s – g e n e r a t e d b y s

  • m

e e v e n t i n t h e p r

  • c

e s s

 a

s y n c h r

  • n
  • u

s – g e n e r a t e d b y a n e v e n t

  • u

t s i d e t h e p r

  • c

e s s

 Wh

e r e t

  • d

e l i v e r a s i g n a l i n m u l t i t h r e a d e d p r

  • g

r a m s ?

d e l i v e r t h e s i g n a l t

  • t

h e t h r e a d t

  • w

h i c h t h e s i g n a l a p p l i e s

d e l i v e r t h e s i g n a l t

  • e

v e r y t h r e a d i n t h e p r

  • c

e s s

d e l i v e r t h e s i g n a l t

  • c

e r t a i n t h r e a d s i n t h e p r

  • c

e s s

a s s i g n a s p e c i fj c t h r e a d t

  • r

e c e i v e a l l s i g n a l s f

  • r

t h e p r

  • c

e s s

slide-23
SLIDE 23

Implicit Threading

 Wr

i t i n g c

  • r

r e c t m u l t i

  • t

h r e a d e d p r

  • g

r a m s i s m

  • r

e d i ffj c u l t f

  • r

p r

  • g

r a m m e r s

 u

s e c

  • m

p i l e r s a n d r u n

  • t

i m e l i b r a r i e s t

  • c

r e a t e a n d m a n a g e t h r e a d s a u t

  • m

a t i c a l l y

 S

  • m

e e x a m p l e m e t h

  • d

s i n c l u d e

 T

h r e a d p

  • l

s

 O

p e n M P

 G

r a n d c e n t r a l d i s p a t c h , M S T h r e a d b u i l d i n g b l

  • c

k s ( T B B ) , j a v a . u t i l . c

  • n

c u r r e n t p a c k a g e

slide-24
SLIDE 24

Thread Pools

 C

  • n

c e r n s w i t h m u l t i t h r e a d e d a p p l i c a t i

  • n

s

 c

  • n

t i n u

  • u

s l y c r e a t i n g a n d d e s t r

  • y

i n g t h r e a d s i s e x p e n s i v e

 o

v e r s h

  • t

i n g t h e b

  • u

n d

  • n

c

  • n

c u r r e n t l y a c t i v e t h r e a d s

 T

h r e a d P

  • l

s

 c

r e a t e a n u m b e r

  • f

t h r e a d s i n a p

  • l

w h e r e t h e y a w a i t w

  • r

k

 n

u m b e r

  • f

t h r e a d s c a n b e p r

  • p
  • r

t i

  • n

a l t

  • t

h e n u m b e r

  • f

p r

  • c

e s s

  • r

s

 A

d v a n t a g e s

 f

a s t e r t

  • s

e r v i c e a r e q u e s t w i t h a n e x i s t i n g t h r e a d t h a n c r e a t e a n e w t h r e a d e v e r y t i m e

 a

l l

  • w

s t h e n u m b e r

  • f

t h r e a d s i n t h e a p p l i c a t i

  • n

( s ) t

  • b

e b

  • u

n d t

  • t

h e s i z e

  • f

t h e p

  • l
slide-25
SLIDE 25

OpenMP

 C

  • m

p i l e r d i r e c t i v e s a n d a n A P I f

  • r

C , C + + , F O R T R A N

 S

u p p

  • r

t s p a r a l l e l p r

  • g

r a m m i n g i n s h a r e d

  • m

e m

  • r

y e n v i r

  • n

m e n t s

 U

s e r i d e n t i fj e s p a r a l l e l r e g i

  • n

 C

r e a t e a s m a n y t h r e a d s a s t h e r e a r e c

  • r

e s

#pragma omp parallel

 R

u n f

  • r

l

  • p

i n p a r a l l e l

#pragma omp parallel for for(i=0 ; i<N ; i++) c[i] = a[i] + b[i];

slide-26
SLIDE 26

Linux Thread Implementation

 L

i n u x r e f e r s t

  • t

h e m a s t a s k s r a t h e r t h a n t h r e a d s

 T

h r e a d c r e a t i

  • n

i s d

  • n

e t h r

  • u

g h c l

  • n

e ( ) s y s t e m c a l l

 c

l

  • n

e ( ) a l l

  • w

s a c h i l d t a s k t

  • s

h a r e t h e a d d r e s s s p a c e

  • f

t h e p a r e n t t a s k ( p r

  • c

e s s )

slide-27
SLIDE 27

Windows XP Thread Implementation

 I

m p l e m e n t s t h e

  • n

e

  • t
  • n

e m a p p i n g , k e r n e l

  • l

e v e l

 E

a c h t h r e a d c

  • n

t a i n s

 A

t h r e a d i d

 R

e g i s t e r s e t

 S

e p a r a t e u s e r a n d k e r n e l s t a c k s

 P

r i v a t e d a t a s t

  • r

a g e a r e a

 T

h e r e g i s t e r s e t , s t a c k s , a n d p r i v a t e s t

  • r

a g e a r e a a r e k n

  • w

n a s t h e c

  • n

t e x t

  • f

t h e t h r e a d s

 T

h e p r i m a r y d a t a s t r u c t u r e s

  • f

a t h r e a d i n c l u d e :

 E

T H R E A D ( e x e c u t i v e t h r e a d b l

  • c

k )

 K

T H R E A D ( k e r n e l t h r e a d b l

  • c

k )

 T

E B ( t h r e a d e n v i r

  • n

m e n t b l

  • c

k )

slide-28
SLIDE 28

Windows XP Threads

slide-29
SLIDE 29

Multicore Processors

 M

u l t i p l e p r

  • c

e s s i n g c

  • r

e s

  • n

a s i n g l e c h i p .

 R

e a s

  • n

s f

  • r

a s h i f t t

  • m

u l t i c

  • r

e p r

  • c

e s s

  • r

s

 p

  • w

e r w a l l

 l

i m i t s t

  • f

r e q u e n c y s c a l i n g

 t

r a n s i s t

  • r

s c a l i n g s t i l l a r e a l i t y

 M

u l t i c

  • r

e p r

  • g

r a m m i n g V s . m u l t i c

  • m

p u t e r p r

  • g

r a m m i n g

 s

a m e

  • c

h i p c

  • m

m u n i c a t i

  • n

i s f a s t e r

 m

e m

  • r

y s h a r i n g i s e a s i e r a n d f a s t e r

slide-30
SLIDE 30

Single Core Vs. Multicore Execution

Single core execution Multiple core execution

slide-31
SLIDE 31

Challenges for Multicore Programming

 D

i v i d i n g a c t i v i t i e s

 B

a l a n c e

 D

a t a s p l i t t i n g

 D

a t a d e p e n d e n c y

 T

e s t i n g a n d d e b u g g i n g