473,385 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to wab for all chilren *processes* to return?

Question : write a program which creates 5 processes (in addition to
itself). One of these processes must display 1, another must display 2
.... the last one displays 5. The parent process waits until all other
processes are finished, then returned.

May 17 '07 #1
3 1065
loudking wrote:
Question : write a program which creates 5 processes (in addition to
itself). One of these processes must display 1, another must display 2
... the last one displays 5. The parent process waits until all other
processes are finished, then returned.
Howto contact your teacher?

--
Tor
May 17 '07 #2
On May 17, 3:18 pm, loudking <loudk...@gmail.comwrote:
Question : write a program which creates 5 processes (in addition to
itself). One of these processes must display 1, another must display 2
... the last one displays 5. The parent process waits until all other
processes are finished, then returned.
However often you ask this, it still won't be on topic here.

May 17 '07 #3

"loudking" <lo******@gmail.comha scritto nel messaggio
news:11**********************@e65g2000hsc.googlegr oups.com...
Question : write a program which creates 5 processes (in addition to
itself). One of these processes must display 1, another must display 2
... the last one displays 5. The parent process waits until all other
processes are finished, then returned.
The thing closest to a portable C way to do that, is displaying argv[1][0]
and flushing stdout if argv[1] is not NULL, and writing some code to copy
argv[0] to a string, append " 1" to it, pass it to system() etc. if argv[1]
is NULL.
But nothing in the Standard requires this to work. The behaviour of system()
and the exact contents of argv[0] are implementation defined.
May 18 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Behrang Dadsetan | last post by:
Hi all, please note that once I finished writing the script someone explained me that there is a command pwait under Solaris... anyway it was fun to write and it did not take long (while I am...
6
by: Bob Swerdlow | last post by:
My application starts up a number of processes for various purposes using: self.popen = popen2.Popen3("/usr/local/bin/python -O "myscript.py") and then shuts them down when appropriate with...
4
by: Jani Yusef | last post by:
I want to create a tree of processes. The depth of the tree is given by the variable depth and the number of processes started by each node is given by the variable numberOfProcesses. Is the...
15
by: Dirk Reske | last post by:
Hello, why doesn't this code work correctly? private int GetCpuUsage(Process proc) { DateTime time1,time2; TimeSpan timediff; double cpu1,cpu2,cpudiff;
5
by: Chris B | last post by:
I have the following situation: Process 1 creates Process 2 (using Process.Start(startInfo) Process 1 needs to wait until Process 2 is initialized before Process 1 can continue to execute Both...
8
by: mandydhaliwal | last post by:
Hi all, I am porting a win32 c++ program on Linux which first reads a list of processes and their paths from a file.Then this program should launch all of thesese processes. I tried to...
3
by: xxs | last post by:
I have writen some codes as follow: #include <windows.h> #include <tlhelp32.h> #include <stdio.h> // Forward declarations: BOOL GetProcessList( ); BOOL ListProcessModules( DWORD dwPID...
1
by: | last post by:
Hi! I'm running a Python program on M$ Windows 2000 as a test monitor. The program should close various processes, mostly "Application error"-windows, as they are created. This works fine until...
1
by: jazon | last post by:
Let me start by saying this for an Operating Systems class. No, I don't expect the work to be done for me. The assignment is as follows: To be honest, I feel like a fish out of water, like...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.