Marcin 'Qrczak' Kowalczyk wrote:
> 
> Wed, 18 Oct 2000 16:32:21 +0200, George Russell <[EMAIL PROTECTED]> pisze:
> 
> > > In a standalone GHC program, only the main thread is required to
> > >   terminate in order for the process to terminate.
> >
> > I have a program (which does some fairly complex things with forking processes,
> 
> The above fact applies to threads (module Concurrent), not processes
> (module Posix).
> 
> In some sense it does apply to processes, but the interface of
> forkProcess allows to "continue execution" with the child process,
> while the main process (parent) waits somewhere.
I don't understand what you mean.  However I don't think that it's that simple.
NB:
   (1) all the child processes do executeFile almost immediately after being forked.
   (2) the main program is still hanging, after printing "Test completed", even
       though according to ps the main program is the only process (apart
       from the enclosing shells) running on that terminal.
> 
> > the very last line of the "main" action is:
> >       putStrLn "Test completed"
> > The program prints "Test completed", but then hangs.
> 
> Quite possible. For example (untested):
I don't see what this example has got to do with mine, since it prints
"Test completed" in the new process, while waiting in the old one.
> 
> main = do
>     pid <- forkProcess
>     case pid of
>         Nothing -> return () -- This is the new process.
>         Just _  -> do
>             -- This is the old process.
>             sleep 100; exitWith ExitSuccess
>     -- This is the new process.
>     putStrLn "Test completed"
> 
> --
>  __("<  Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
>  \__/
>   ^^                      SYGNATURA ZAST�PCZA
> QRCZAK
> 
> _______________________________________________
> Glasgow-haskell-bugs mailing list
> [EMAIL PROTECTED]
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to