> > I'd like to get forkProcess# fixed in 6.2, even if that 
> means changing
> > the interface.
> >
> > First, could you explain exactly the problems with implementing the
> > current version of forkProcess?  Do we only run into 
> problems when we
> > try to implement forkProcess in the threaded RTS?
> 
> We run into quite different problems whether we use the 
> threaded RTS or 
> not.
> With the non-threaded RTS, the current situation is that we keep not 
> only the
> current thread, but also all other main threads.
> I think that we cannnot do better than that. Every main thread is due 
> to a call-in into Haskell; all except the intial one are therefore 
> indirectly caused by a safe foreign call out of Haskell.
> So we have the stack frames for each of these call-outs on the (only) 
> OS thread's stack. As we can't remove a stack frame from the 
> middle of 
> the C stack, we cannot delete main threads. Period.

Couldn't we just fix this as follows:

  Delete all other threads in the system (including main threads).
  The thread that forked becomes a new main thread, but instead of
  returning when it exits, the RTS will simply stop.

This is a small change to the semantics, but it should be easy to
implement and I doubt it will affect anybody currently using
forkProcess.

Cheers,
        Simon

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

Reply via email to