Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-23-2010, 11:29 AM   #1
LQ Newbie
Registered: Dec 2010
Posts: 4

Rep: Reputation: 0
Lightbulb Parent and child process

I want to write a C language program which used signalling and the features are,

1. There is a parent process.
2. Then the parent process creates a child process.
3. Child process prints "1".
4. Child process stops.
5. Parent process then send a signal to child for printing next message.
6. Same child process again prints "2".
7. Child process stops.
8. Parent process then send a signal to child for printing next message.
9. Same child process prints "3".
10.Parent process then send a signal to child for printing next message.
11. Same child process prints "It's enough now!".
12. Then child process terminates.

Please help me regarding to problem statement.

Thank you.

Last edited by Iyyaaz; 12-23-2010 at 01:20 PM.
Old 12-23-2010, 12:26 PM   #2
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian except for netbook still on Slackware 13.37 (and I have to support Ubuntu)
Posts: 8,572
Blog Entries: 30

Rep: Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182
The "problem statement" (= specification?) looks complete and do-able ("stops" might have to be "loops slowly"). Are you asking about how to implement it? If so, which language do you want?
Old 12-23-2010, 09:56 PM   #3
Deep Narayan Dubey
LQ Newbie
Registered: Dec 2010
Location: Allahabad, India
Posts: 11

Rep: Reputation: 8
First of all I think this not the right forum to ask this question.

Regarding your question, you can use binary semaphore and you can see the code for the producer consumer problem where parent process is a producer which produces the signal and child process is consumer which consumes the signal and prints the value.
Old 12-24-2010, 02:17 PM   #4
Senior Member
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 231Reputation: 231Reputation: 231
Deep Narayan Dubey,

You're right, this is the wrong forum. I will move it to Programming after moderation.


Is this homework? If so, please say so up front.
While it is against LQ policy to ask us to do your homework for you:
Do not expect LQ members to do your homework - you will learn much more by doing it yourself.
you may find many members will help you help yourself.

Please make your next post an answer to this question. TIA.

Last edited by archtoad6; 01-16-2011 at 05:42 AM. Reason: typo
Old 01-02-2011, 11:20 AM   #5
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,545

Rep: Reputation: 160Reputation: 160
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.

However, please answer to archtoad6 question.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending Signal from Child Process to Parent Process : Not getting desired output thelink123 Linux - General 4 10-26-2012 09:05 PM
Can a child process kill the parent process ? sree_ec Programming 8 11-20-2010 05:37 AM
child process usses same amount of ram as parent process socialjazz Programming 7 10-19-2006 05:48 PM
Bash Scripting - child process affecting parent process mthaddon Linux - General 1 05-02-2004 01:19 PM
about parent and child process winwar Solaris / OpenSolaris 3 07-23-2003 06:07 AM

All times are GMT -5. The time now is 06:20 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration