Homework Assignment #7
CSE 452: Fall 2004

Due: 12/07/04


Instructions: Answer each question below. Your answers must be generated using a common word processing program such as MS Word or LaTex (handwritten work will not be accepted). Figures may be hand-drawn or you may generate these using a graphics package such as XFig. Hand in all answers in hardcopy form (no emails) by the due date shown.
From Chapter 9:
1. Name three important benefits of abstraction.

Reduces the conceptual load my minimizing detail.

Provides independence among program components.

Provides fault containment.

2. What happens to the implementation of a class if we redefine a data member? For example, suppose we have:
class foo {
public:
int a;
char *b;
};

class bar : public foo {
public:
float c;
int b;
};
Does the representation of a bar object contain one b field or two? If two, are both accessible, or only one? Under what circumstances?

The object bar contains two “b” fields one of type int and one of type char. Both are accessible through the use of scope resolution operator (e.g. foo::b, bar::b).


From Chapter 15:
3. What is interrupt-driven I/O? What does it have to do with
concurrency?

Requests for I/O generate interrupts that result in the requesting process being suspended, allowing the CPU to handle other processes while I/O is completed, generally by a separate I/O controller.

4.  What is a critical section? Name two factors that must be satisfied to ensure the integrity of the critical section.

A critical block of code that is shared by multiple processes, and which must only be accessed by one process at a time. Factors which must be satisfied include:
a). Mutual exclusion
b). Progress must be made (no starvation) and a process must not
be prevented from entering the critical section by other processes
not in the critical section.
c). Bounded waiting, a process attempting to enter the critical section
must eventually be allowed to do so.