LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to create multiple children before any child executes? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-create-multiple-children-before-any-child-executes-828856/)

Ambika5589 08-27-2010 12:54 PM

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

TB0ne 08-27-2010 01:41 PM

Quote:

Originally Posted by Ambika5589 (Post 4079807)
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...

johnsfine 08-27-2010 02:01 PM

Quote:

Originally Posted by Ambika5589 (Post 4079807)
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 (Post 4079866)
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 (Post 4079807)
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.

TB0ne 08-27-2010 11:47 PM

Quote:

Originally Posted by johnsfine (Post 4079896)
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.


All times are GMT -5. The time now is 09:14 AM.