unsafePerformIO and cooperative concurrency

Simon Marlow simonmar at microsoft.com
Mon Apr 24 08:57:57 EDT 2006

Given that unsafePerformIO is (perhaps) to be part of the Haskell'
standard, the combination of unsafePerformIO and cooperative concurrency
introduces some interesting cases that will probably have to be declared
to be undefined in the standard - what happens when you yield or do some
I/O inside unsafePerformIO?

I guess a concurrent foreign call executed from inside unsafePerformIO
doesn't work either?  What about a reentrant one?  (I know that
reentrant foreign calls currently don't work inside unsafePerformIO in
Hugs, IIRC it can lead to a segfault).  So does this mean that a foreign
call that doesn't return an IO type cannot be declared concurrent?


More information about the Haskell-prime mailing list