Homework 7

22C:116, Fall 1998

Due Monday Oct 12, 1998, in class

Douglas W. Jones
  1. Consider the following little C program:
    	int a;
    
    	void t( int * p, void (*f) (void *, void *) )
    	{
    		if (0 == *p) {
    			printf( "some output\n" );
    		} else {
    			(*p)--;
    			(*f)( p, f );
    		}
    	}
    
    	void main()
    	{
    		a = 1;
    		t( &a, t );
    	}
    
    Show the complete access matrix describing this program at the instant it outputs "some output". As resources, list each item that may be denoted by an identifier in this program, and as users, list each distinct block or scope in which names are defined.

  2. Explain how the notion of gate-crossing relates to the concept of a kernel call in UNIX and to the distinction between kernel calls and calls to routines in the standard library.

  3. Recently, two new tools have become available, one is a chip that can directly read a fingerprint when a person touches it, and the other is a software system that can scan the distinctive patterns in the iris of a person's eyes using a TV camera. Note that the pattern of radial lines in a person's iris is as distinctive as a fingerprint. These are mechanisms. To what specific security problems do these mechanisms apply?

  4. Explain, for our example thread package, why the error message "Possible deadlock" does not mean that there is certainly a deadlock. That is, what other possible circumstances could lead to this message?

  5. Discuss the feasibility of adding code to our thread package (with semaphores included) to automatically detect all deadlocks when they occur. If it is possible, what algorithms would you use, and if it is not possible, why?