4 ms·
Does anybody know of experiments with using auto-threading in the Haskell compiler? Is there work underway to do this?
by rgbrgb 14y ago
Does anybody know of experiments with using auto-threading in the Haskell compiler? Is there work underway to do this?
- marshray 14y agoTo some degree "it just works" today. For example, see the end of http://gisli.hamstur.is/2012/12/network-programming-in-haskell/ http://gisli.hamstur.is/2012/12/network-programming-in-haske... By using Haskell you get multi-core support for free, so if you want to distribute the request handling over the cores in your machine you simply execute the server like so. Substitute x in -Nx with the number of cores you want to use. $ ./network-server +RTS -Nx I don't think this gets you the same kind of fine-grained parallelism as the research compiler. But I could be wrong.
- jfoutz 14y agoIf you only have one thread, you'll only use 1 core (maybe 2 with gc) A network application is a great use case. Usually you'll have one thread per connection. In a more "normal" application you'll need to make threads. one very easy way to do that is pmap, map a function over data and spark a thread for each function invocation. But then you need to worry about the cost of creating threads vs the amount of work done, etc. there are always tradeoffs.