CSCI305.github.io

CSCI 305 Homework 6

Due Date: April 27, 2018 @ Beginning of Class



Name:                                                                                        




Cost Models

  1. For each of the following, give a formula for computing the address to use for the array reference. Assume that the array A is allocated as single block at address base, and let size be the size of an individual array element. (2 points)

Concurrency

(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.