[Haskell-cafe] forkIO on GHCI does not seem to spawn the thread in the background on some OSs
David Leimbach
leimy2k at gmail.com
Wed Feb 9 18:21:49 CET 2011
> > It is not always a thread. ForkIO creates a spark and then the
> > scheduler decides when sparks should be scheduled to threads. Thus
> > you get a guarantee of concurrent but not parallel execution.
>
> That is not correct - it is "par" that creates sparks may be discarded.
>
I guess I should have been clearer. A forkIO thread is not an OS thread
necessarily. Sparks may become threads or be discarded in the par sense.
> forkIO always creates new threads, though it is of course up to the
> scheduler
> when the threads are executed, and how many cores are used.
>
Yes, this is my understanding as well.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110209/ebdf0209/attachment.htm>
More information about the Haskell-Cafe
mailing list