1 Replies - 1120 Views - Last Post: 09 October 2011 - 06:36 PM

#1 desperateeee   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 09-October 11

program that forks two processes in parallal and let child 1 signal ..

Posted 09 October 2011 - 06:22 PM

Dear Computer scientists community, I have an issue

A professor asked us to do the following homework

using sleep(), using alarm(), signal(), and pause().
• Write a program that forks two processes in parallel (i.e., 1 parent and 2
childs). After 2 seconds, let child_1 signal child_2. This latter, should print
that he received a signal from child_1. After 3 seconds, child_2 should
signal the parent, and have this latter print that he received a signal from
child_2. Upon receiving the last signal, the parent kills his 2 children, and
the children should print a “Termination message” when killed.

And when I asked him about the parallel begining. he said that I should open two terminals in linux and run the program which would similate a parallel begining.

Do any one of you have a clue about what to do ? thanks in advance

Is This A Good Question/Topic? 0
  • +

Replies To: program that forks two processes in parallal and let child 1 signal ..

#2 blackcompe   User is offline

  • D.I.C Lover
  • member icon

Reputation: 1159
  • View blog
  • Posts: 2,547
  • Joined: 05-May 05

Re: program that forks two processes in parallal and let child 1 signal ..

Posted 09 October 2011 - 06:36 PM

I wouldn't worry about the parallel part, just fork two processes. They'll be running in parallel. There's no way have to processes/threads start at the exact same time.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1