L3 & L4 Flashcards
True or False:
The threads in the same process share a different address space.
False.
They share the same address space.
A program runs on a CPU as a ______.
process
How do threads communicate?
shared memory
What are some ways to program threads?
Pthread library (C/C++/Fortran)
Java threads
What return value indicates a success for pthreads?
0
What is used in pthread to:
a. create a thread
b. exit a thread
c. wait for a thread to finish
a. pthread_create()
b. pthread_exit()
c. pthread_join()
How can the order of thread execution be controlled?
Synchronisation
What is the difference between implicit and explicit parallelism?
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
Why is automatic parallelisation difficult?
because dependency analysis is hard
If threads do not share memory, how is communication done?
via message passing
What is the cache coherency problem in multiprocessors?
Challenge of maintaining consistency and avoiding data inconsistencies when multiple processors or cores share a common memory and have their own caches.