aboutsummaryrefslogtreecommitdiffhomepage
path: root/System/Posix/Process.hsc
diff options
context:
space:
mode:
authorGravatar Simon Marlow <simonmar@microsoft.com>2007-03-01 15:12:20 +0000
committerGravatar Simon Marlow <simonmar@microsoft.com>2007-03-01 15:12:20 +0000
commit3a976449bff4296b5d02043f75ae80e7e5c33b9b (patch)
tree7c2f788c6e5b75d98ce068c6b819752f7e8d1ae8 /System/Posix/Process.hsc
parentb76084ef81d1d48782920dbd81fbdf30db5a4e3a (diff)
expand docs for forkProcess
Diffstat (limited to 'System/Posix/Process.hsc')
-rw-r--r--System/Posix/Process.hsc10
1 files changed, 10 insertions, 0 deletions
diff --git a/System/Posix/Process.hsc b/System/Posix/Process.hsc
index 8951383..9962d94 100644
--- a/System/Posix/Process.hsc
+++ b/System/Posix/Process.hsc
@@ -243,6 +243,16 @@ The 'IO' action passed as an argument is executed in the child process; no other
threads will be copied to the child process.
On success, 'forkProcess' returns the child's 'ProcessID' to the parent process;
in case of an error, an exception is thrown.
+
+'forkProcess' comes with a giant warning: since any other running
+threads are not copied into the child process, it's easy to go wrong:
+e.g. by accessing some shared resource that was held by another thread
+in the parent. Another example is the I\/O manager thread: since the
+I\/O manager isn't running in the child, attempting to do any
+Handle-based I\/O will deadlock.
+
+Using 'forkProcess' in order to do 'executeFile' is likely to work.
+Anything else: you're on your own.
-}
forkProcess :: IO () -> IO ProcessID