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. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-23-2010, 11:29 AM
|
#1
|
|
LQ Newbie
Registered: Dec 2010
Posts: 4
Rep:
|
Parent and child process
Hi,
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.
|
|
|
|
12-23-2010, 12:26 PM
|
#2
|
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian Squeeze (server), Slackware 13.37 (netbook), Slackware64 14.0 (desktop),
Posts: 8,367
|
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?
|
|
|
|
12-23-2010, 09:56 PM
|
#3
|
|
LQ Newbie
Registered: Dec 2010
Location: Allahabad, India
Posts: 11
Rep:
|
Hi,
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.
|
|
|
|
12-24-2010, 02:17 PM
|
#4
|
|
Senior Member
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
|
Deep Narayan Dubey,
You're right, this is the wrong forum. I will move it to Programming after moderation.
Iyyaaz,
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:
Quote:
|
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
|
|
|
|
01-02-2011, 11:20 AM
|
#5
|
|
Moderator
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,479
Rep: 
|
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 |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 04:27 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|