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.
> 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):
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