A
is allocated as single block at address base
, and let size
be the size of an individual array element. (2 points)A[i]
, where 0 ≤ i ≤ n
A[i] -> base + i*size
A[i][j][k]
, where 0 ≤ i ≤ m
, 0 ≤ j < n
, and 0 ≤ k < p
, and where the array is allocated in column-major order.
A[i][j][k] -> base + (i * p * size) + (j * (m + 1) * p * size) + (k * size)
(1) What are the three possible levels of concurrency in programs? (3 points)
(2) Describe the logical architecture of an MIMD computer. (3 points)
(3) Define the following terms: (3 points)
(4) What is the best action a system can take when deadlock is detected? (2 points)
Resource preemption: resources allocated to various processes may be successively preempted and allocated to other processes until the deadlock is broken.
(5) How are explicit locks supported in Java? (2 points)
Explicit locks are provided in Java via the Lock interface and its realizations. These provide the methods lock()
and unlock()
. Specifically one can use either of the ReentrantLock
or ReentrantReadWriteLock
. Once a lock has been instantiated, calling lock()
on that locks the resource until unlock()
is called.