Assignment_2 - Student name Assignment 2 Rules a You should...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Student name: _____________________ Assignment 2 Rules: a) You should clearly indicate the used commands b) You are request to work individually and respect the academic honesty as stated in the syllabus c) Syntax errors are not allowed, they only indicate that you did not test your program d) Your homework should be typed, printed and stapled, no hand written is allowed e) Due date is December 10, 2010. No late policy (if you are late you get a 0) _______________________________________________________________________ _ Exercise 1: The goal of this exercise is to learn how to use fork and wait , then to combine fork and execlp within a C program. In addition, you will observe the user process states using the command ps . 1) Write a program within a parent process that launches n children processes. The value of n should be read from the keyboard, we also need to verify that n is less than or equal to 10. Every child will have a number between 1 and n , it has to wait a random number of seconds between 1 and 20. The child process starts by showing its number, pid, waiting delay, and terminates by showing its number and pid. The parent process has to show the
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern