> It circumvents them by being much simpler.
> 
> forkProcess' :: IO () -> IO ProcessID
> 
> The main difference is that the action to be executed in the child 
> process is guaranteed not to return to some thread that we might have 
> deleted.
> So in the child process, we just do the following:
> - delete _all_ Haskell threads
> - make note of the fact that we have no worker threads any more
> - "foreign-call" the action that we are supposed to execute 
> (it is run 
> in a new Haskell thread bound to the current OS thread)
> - clean up and exit()
> 
> It works for both the threaded RTS and the non-threaded RTS (for the 
> non-threaded case, ignore the phrase "bound to the current OS 
> thread").
> 
> I'm not aware of any case where the more limiting type signature of 
> forkProcess' would be a problem, so I really like that simplicity.

Ok, I am convinced.  Your version of forkProcess has a nice clean
implementation, and its semantics are easy to describe.  Would you like
to go ahead and implement?

Cheers,
        Simon
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to