Homework 3, More Chapter 3.

Short Description:

  • Answer questions and write a program related to the material on chapters 2 and 3.

    Goals

    When you finish this homework, you should have:

    Formal Description

    Perform/answer the following
    1. [10 points] Using the code examples provided, write a program that will fill an array with data using two processes.
      • Set up a shared memory segment of 20 characters.
      • Create a child process which will:
        • fill all odd locations (1, 3, 5, ... ) in the array with the letter 'c'.
        • exit
      • The parent should:
        • fill all even locations (0, 2, ...) in the array with the letter 'p'
        • wait for the child to exit
        • print the contents of the array (index:value, one per line)
          0:p
          1:c
          ...
          19:c 
        • clean up shared memory
        • exit
      I intend you to use the example provided in class, it should be an easy adaptation.

      Place the source code for this program in Homework 3: Code

    2. In a word document answer the following:
      1. [6 points] Describe the different states of the life cycle of a process.
      2. [2 points] What is an orphan process?
      3. [2 points] What is a zombie process?
      4. [4 points] What is the significance of fork using copy on write for memory allocation after the fork occurs?
      5. [6 points] Describe the two different high level IPC mechanisms.
      6. [10 points] Look at wine.
        • Discuss Wine as it relates to this class.
        • Possible discussion points. (But you may address others as well)
          • Is Wine an OS, emulator, library, loader, ...?
          • What OS like services does Wine provide?
          • What OS like services does Wine fail to provide?

    Required Files

    A word document and a C/C++ file.

    Submission