ITSC 3146 Test 2 Review Latest Update
There needs to be an ____ mechanism for data sharing among different
processes. - ANSWER explicit
The sharing mechanism is _____ for threads of the same process. - ANSWER
implicit
The bank example demonstrated that threads must not be
_________
when accessing shared data. This means that when one thread is accessing
shared data, no other thread should be allowed to
_________
that same shared data. - ANSWER interleaved, access
According to example in the video, the rules of strict alternation stipulate that
while one of the siblings is taking a turn the other sibling must ____. - ANSWER
wait
Mutual ______ is the idea that when one thread enters its critical region, the
other thread cannot enter its critical region. This is a benefit of strict alternation.
- ANSWER exclusion
Busy _____ is a drawback of strict alternation because processes waste CPU
cycles unnecessarily by repeatedly checking the turn variable. - ANSWER
waiting
In the code presented for Peterson's solution, a process will indicate that it is
leaving the critical region by setting the interested flag to FALSE in the _____
method. - ANSWER leave_region
In _________ a process does not have to wait unless another process is taking a
turn or has expressed interest in taking a turn. In Strict Alternation , on the other
hand, a process must wait until the other process has taken a turn, even if
another process is not interested in taking a turn is not taking a turn. - ANSWER
Peterson's Solution, Strict Alternation
Busy waiting uses CPU cycles because it is constantly checking or _____ the
status of critical region entry. - ANSWER polling
An alternative to busy waiting is to put the thread to
, _____
instead of having it continually poll the status of critical region entry. This
effectively blocks or suspends the thread from
_______
. - ANSWER sleep, execution
A ___ is a shared variable that can be in either a locked state or a an unlocked
state. - ANSWER mutex
With a mutex, a thread or process that wishes to enter the critical region must
invoke a ____ operation. - ANSWER lock
With a mutex, the thread_yield call means that the current thread or process
yields the ____ so another process or thread can be scheduled instead. -
ANSWER CPU
In the pthread library you would declare a variable of type ____ to create the
global mutex variable. - ANSWER pthread_mutex_t
The pthread_mutex_lock method takes a _____ to the mutex variable as the
parameter. - ANSWER pointer
In the example in the video the bank balance will always be the same no matter
how many times we run the program because we can be sure that threads are
accessing the balance variable in a ____ manner by using a mutex variable. -
ANSWER safe
Task decomposition is when multiple threads execute ______ with ______ data
whereas data decomposition is when multiple threads execute ________ with
______ data. - ANSWER different functions ,
the same,
different functions,
different
A approach in which a thread executes a function and
______
output data, which is then
_____
by another thread executing a different function is referred to as ____
______
decomposition. - ANSWER produces, consumed, data, flow
A way to facilitate
____ ____
decomposition is to use a
_____ _____
There needs to be an ____ mechanism for data sharing among different
processes. - ANSWER explicit
The sharing mechanism is _____ for threads of the same process. - ANSWER
implicit
The bank example demonstrated that threads must not be
_________
when accessing shared data. This means that when one thread is accessing
shared data, no other thread should be allowed to
_________
that same shared data. - ANSWER interleaved, access
According to example in the video, the rules of strict alternation stipulate that
while one of the siblings is taking a turn the other sibling must ____. - ANSWER
wait
Mutual ______ is the idea that when one thread enters its critical region, the
other thread cannot enter its critical region. This is a benefit of strict alternation.
- ANSWER exclusion
Busy _____ is a drawback of strict alternation because processes waste CPU
cycles unnecessarily by repeatedly checking the turn variable. - ANSWER
waiting
In the code presented for Peterson's solution, a process will indicate that it is
leaving the critical region by setting the interested flag to FALSE in the _____
method. - ANSWER leave_region
In _________ a process does not have to wait unless another process is taking a
turn or has expressed interest in taking a turn. In Strict Alternation , on the other
hand, a process must wait until the other process has taken a turn, even if
another process is not interested in taking a turn is not taking a turn. - ANSWER
Peterson's Solution, Strict Alternation
Busy waiting uses CPU cycles because it is constantly checking or _____ the
status of critical region entry. - ANSWER polling
An alternative to busy waiting is to put the thread to
, _____
instead of having it continually poll the status of critical region entry. This
effectively blocks or suspends the thread from
_______
. - ANSWER sleep, execution
A ___ is a shared variable that can be in either a locked state or a an unlocked
state. - ANSWER mutex
With a mutex, a thread or process that wishes to enter the critical region must
invoke a ____ operation. - ANSWER lock
With a mutex, the thread_yield call means that the current thread or process
yields the ____ so another process or thread can be scheduled instead. -
ANSWER CPU
In the pthread library you would declare a variable of type ____ to create the
global mutex variable. - ANSWER pthread_mutex_t
The pthread_mutex_lock method takes a _____ to the mutex variable as the
parameter. - ANSWER pointer
In the example in the video the bank balance will always be the same no matter
how many times we run the program because we can be sure that threads are
accessing the balance variable in a ____ manner by using a mutex variable. -
ANSWER safe
Task decomposition is when multiple threads execute ______ with ______ data
whereas data decomposition is when multiple threads execute ________ with
______ data. - ANSWER different functions ,
the same,
different functions,
different
A approach in which a thread executes a function and
______
output data, which is then
_____
by another thread executing a different function is referred to as ____
______
decomposition. - ANSWER produces, consumed, data, flow
A way to facilitate
____ ____
decomposition is to use a
_____ _____