L3 & L4 Flashcards

1
Q

True or False:

The threads in the same process share a different address space.

A

False.

They share the same address space.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A program runs on a CPU as a ______.

A

process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do threads communicate?

A

shared memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are some ways to program threads?

A

Pthread library (C/C++/Fortran)
Java threads

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What return value indicates a success for pthreads?

A

0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is used in pthread to:
a. create a thread
b. exit a thread
c. wait for a thread to finish

A

a. pthread_create()
b. pthread_exit()
c. pthread_join()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can the order of thread execution be controlled?

A

Synchronisation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the difference between implicit and explicit parallelism?

A

Explicit parallelism: programmer explicitly spells out what should be parallelized (ex: OpenMP)

Implicit parallelism: the system works out parallelism by itself without the programmer modifying the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Why is automatic parallelisation difficult?

A

because dependency analysis is hard

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

If threads do not share memory, how is communication done?

A

via message passing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the cache coherency problem in multiprocessors?

A

Challenge of maintaining consistency and avoiding data inconsistencies when multiple processors or cores share a common memory and have their own caches.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly