MR K P SCHUPKE wrote:
A final point someone made about the cost of starting threads... Surely the obvious approach
is to start one OS thread per execution unit, and do all the thread starting with the very
lightweight haskell threads...

That was me. I think you're underestimating the cost of starting threads even in this very lightweight world. Again, tens of instructions between startup, shutdown, and (very important) synchronization to make sure that other threads see the results which were produced. It *can* be done without locks, but it often can't be done without memory fences of some sort.


If you actually have to start OS threads, the cost is thousands or tens of thousands of cycles.

Even with very lightweight thread creation, you probably don't want to do a multiplication in a separate thread---unless it's, say, an Integer multiply with a minimum of a thousand digits or so.

-Jan-Willem Maessen

Keean


_______________________________________________ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to