[Haskell-cafe] haskell and releasing resources

Joachim Breitner mail at joachim-breitner.de
Wed Feb 7 05:22:35 EST 2007


Hi,

Am Mittwoch, den 07.02.2007, 11:05 +1100 schrieb Donald Bruce Stewart:
> > Am Dienstag, den 06.02.2007, 15:56 +0100 schrieb Fawzi Mohamed:
> > > I am replying to myself, but anyway with it seems (from the  
> > > documentation) that
> > > 
> > >      forkIO (do{ waitForProcess pid; return () })
> > > 
> > > is the best solution, and does not seem to lead to wasted resources.
> > 
> > This does not work for me. According to strace, the spawned process is
> > in a blocking write, the haskell process is in a blocking waitpid, and I
> > am sure that the program would consume all output.
> > 
> 
> Any difference with -threaded ?

Yes: Then it works. Strangely it also depends on which machine the same
binary runs: On my desktop, it works even without threaded, but on the
server it hangs.

Are there any disadvantages of -threaded? Zombie processes are not too
bad, after all.

Greetings,
Joachim

-- 
Joachim Breitner
  e-Mail: mail at joachim-breitner.de
  Homepage: http://www.joachim-breitner.de
  ICQ#: 74513189


More information about the Haskell-Cafe mailing list