LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-27-2010, 12:54 PM   #1
Ambika5589
LQ Newbie
 
Registered: Aug 2010
Posts: 1

Rep: Reputation: 0
Unhappy How to create multiple children before any child executes?


Hello ,
Iv got an assignment to complete and I'm stuck at the basic level.
A part of the assigned problem is :

The main process will read the file, and will create N number of child processes (Where N is taken as input) as early as possible before all the children starts its execution. Before
creation of each child, the main process should read the file to store all the required data in then corresponding data structure.
Child processes should not read the file for getting their information.

As far as my knowledge about this , the child executes before the parent . How do I make the parent not pass the control to it's children before it finishes creating all the children?

Thanks
 
Old 08-27-2010, 01:41 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,705

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by Ambika5589 View Post
Hello ,
Iv got an assignment to complete and I'm stuck at the basic level.
A part of the assigned problem is :

The main process will read the file, and will create N number of child processes (Where N is taken as input) as early as possible before all the children starts its execution. Before
creation of each child, the main process should read the file to store all the required data in then corresponding data structure.
Child processes should not read the file for getting their information.

As far as my knowledge about this , the child executes before the parent . How do I make the parent not pass the control to it's children before it finishes creating all the children?

Thanks
Sounds VERY much like homework. What does your textbook say? Version/distro of Linux? What language are you writing this in?? Details wouldn't hurt...
 
Old 08-27-2010, 02:01 PM   #3
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by Ambika5589 View Post
Iv got an assignment to complete and I'm stuck at the basic level.
A part of the assigned problem is :

The main process will read the file, and will create N number of child processes (Where N is taken as input) as early as possible before all the children starts its execution.
That makes me wonder whether the person who wrote it speaks English, which makes me wonder whether you quoted the assignment or whether you translated or paraphrased the assignment.

Your first objective should be to figure out what those instructions mean.

If it really does mean something that is harder to do than is appropriate to the level of your class, you should be able to get some help here with that technical issue, after trying harder to find out what your instructor really meant.

Quote:
Originally Posted by TB0ne View Post
Sounds VERY much like homework.
I assume it is. I don't think that means we can't help. It means we shouldn't do the homework. It doesn't mean we shouldn't explain things.

Quote:
What does your textbook say?
Quote:
Originally Posted by Ambika5589 View Post
the child executes before the parent .
Maybe that is from the textbook. Anyway, we can safely assume the textbook has nothing more constructive than that to say about how to do the unreasonable thing that is the apparent meaning of the assignment.

Quote:
Version/distro of Linux? What language are you writing this in?? Details wouldn't hurt...
Often those things are relevant. Probably not this time.

Even though posting exact text of a homework assignment is generally disapproved of here, I think it should be OK for the OP to post exact text of the assignment and highlight the bizarre part and ask opinions on "what do you think the instructor actually meant by this nonsense?".

But is it practical to ask the instructor what this part of the instructions means? That approach may be more productive.

Last edited by johnsfine; 08-27-2010 at 02:09 PM.
 
Old 08-27-2010, 11:47 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,705

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by johnsfine View Post
That makes me wonder whether the person who wrote it speaks English, which makes me wonder whether you quoted the assignment or whether you translated or paraphrased the assignment.

Your first objective should be to figure out what those instructions mean.

If it really does mean something that is harder to do than is appropriate to the level of your class, you should be able to get some help here with that technical issue, after trying harder to find out what your instructor really meant.



I assume it is. I don't think that means we can't help. It means we shouldn't do the homework. It doesn't mean we shouldn't explain things.




Maybe that is from the textbook. Anyway, we can safely assume the textbook has nothing more constructive than that to say about how to do the unreasonable thing that is the apparent meaning of the assignment.



Often those things are relevant. Probably not this time.
Perhaps, perhaps not. However, the OP should provide details when asking ANY question. Plus, if this is a verbatim homework question, such details will be...lacking...
Quote:
Even though posting exact text of a homework assignment is generally disapproved of here, I think it should be OK for the OP to post exact text of the assignment and highlight the bizarre part and ask opinions on "what do you think the instructor actually meant by this nonsense?".

But is it practical to ask the instructor what this part of the instructions means? That approach may be more productive.
I agree with you. Help is always offered, although that requires the OP actually do research, and come ask things when stumped. That's the time we help each other, in my opinion.
 
  


Reply



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
C - Using pipes with a parent that has multiple children golmschenk Programming 5 03-07-2010 03:30 PM
Getting Key and Create events from all window children with Xt LonelyStar Programming 4 09-27-2007 07:27 AM
how do you create two children using fork() rdtgr Programming 6 12-03-2006 10:18 AM
Children to be adopted into home of a Child Molester littlejimm General 0 12-01-2003 07:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:43 AM.

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