Project 1 (Page 1) - PowerPoint PPT Presentation

1 / 4
About This Presentation
Title:

Project 1 (Page 1)

Description:

Have a Parent process create two child processes, called Child1 and Child2. ... Make sure neither Child1 nor Child2 can catch SIGUSR1. ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 5
Provided by: faculty99
Category:
Tags: child1 | page | project

less

Transcript and Presenter's Notes

Title: Project 1 (Page 1)


1
Project 1 (Page 1)
  • Write a program that meets the following
    specifications. Have a Parent process create two
    child processes, called Child1 and Child2. Then,
    set up a ring between the three processes. Have
    your program use ARGV/ARGC to read two parameters
    into the program called Param1 and Param2.
    Param1 is a UNIX command to be executed such as
    ls l, and Param2 is the name of a data file
    called MY.DAT that does not exist in your
    directory at program start.

2
Project 1 (Page 2)
  • Execute your program in the background, and have
    it block at Parent until SIGUSR1 is raised by you
    at the user prompt. When SIGUSR1 is raised, have
    Parent bundle the command, Param1, into a buffer
    called COMMAND and pass it to Child1. Make sure
    neither Child1 nor Child2 can catch SIGUSR1.
    Then have Child1 execute the command and place
    the result into another buffer called RESULT,
    where it is passed to Parent and then over to
    Child2. Then have Child2 enter an infinite loop
    until SIGUSR2 is raised by you at the user
    prompt.

3
Project 1 (Page 3)
  • Ensure that only Child2 can catch SIGUSR2. When
    caught, SIGUSR2 raises an interrupt handling
    routine that writes the contents of the RESULT
    buffer to youre MY.DAT file and writes a
    duplicate copy to a data file in the instructors
    account called myoutput_mn, where mn is a magic
    number that I assign to your project group. For
    example, if I assign you mn 14, you will write
    your output to
  • /usr/faculty/Hilzer/csci640/project1/myoutput_14

4
Project 1 (Page 4)
  • During execution of the program, write the
    activities of each process to standard error so
    that it is clear by reading the screen what each
    process is doing. Ensure that all processes
    terminate normally leaving no zombies.
Write a Comment
User Comments (0)
About PowerShow.com