Test 1 - Processes

CS 505, Operating Systems Concepts


  1. What is the difference between a procedure call and a system call?


    A procedure call passes control between two parts of the same process in user space. A system call passes control between a process in user space and the operating system in system space.


  2. What is mutual exclusion? What is a critical region?


    Mutual exclusion is a form of resource access that ensures that a resource shared among several executing entities (processes or threads) is accessed by only one entity at a time. A critical region is a finite section of an entity's code within which the entity is guaranteed to have mutually exclusive access to a shared resource.


  3. Construct a critical region using semaphores. Don't forget to show the semaphore's initial value.


    global semaphore mutex = 1
    
    /* other code */
    
    down(mutex) /* enter critical region */
    
    /* access shared resource */
    
    up(mutex) /* leave critical region */
    
    


  4. Is it reasonable to have a scheduler that is both non-preemptive and priority based? Explain your answer.


    Yes, it is reasonable. A non-preemptive scheduler must let the running process decide to release control of the CPU. However, once the CPU is free, the scheduler needs to pick the next process to run, and using a priority-based selection mechanism is reasonable.



This page last modified on 6 March 2000.