Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   How to wab for all chilren *processes* to return? (http://www.velocityreviews.com/forums/t507253-how-to-wab-for-all-chilren-processes-to-return.html)

loudking 05-17-2007 02:18 PM

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.


Tor Rustad 05-17-2007 03:50 PM

Re: How to wab for all chilren *processes* to return?
 
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

Francine.Neary@googlemail.com 05-17-2007 06:56 PM

Re: How to wab for all chilren *processes* to return?
 
On May 17, 3:18 pm, loudking <loudk...@gmail.com> 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.


However often you ask this, it still won't be on topic here.


Army1987 05-18-2007 02:47 PM

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

"loudking" <loudking@gmail.com> ha scritto nel messaggio
news:1179411530.612369.203030@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.




All times are GMT. The time now is 04:26 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.