[Haskell-cafe] Question about forkIO

Donn Cave donn at avvanta.com
Thu Feb 28 16:37:27 CET 2013


Quoth C K Kashyap <ckkashyap at gmail.com>,
...
> Say I have a haskell function 'f' that does a forkIO and starts an action
> "a".  I create a DLL of this haskell code and inovke "f" from C. Can I
> expect the "a" to continue to run once "f" has returned to C?

Once control returns to f's caller, outside of the Haskell runtime,
then there isn't any way to dispatch IO threads - that's done by
the runtime, so it can happen only while executing in the runtime.
I am not a forkIO expert, that's just how it appears to me from my
limited understanding of how they work.

For extra credit - do the old IO threads resume if you call 'f' again,
so you'd have more each time?  (I don't know!)

	Donn



More information about the Haskell-Cafe mailing list