Hacker News new | past | comments | ask | show | jobs | submit login

Are you familiar with Haskell's threading model (sparks) and making an assessment based on that, or is it an unbased claim? Haskell has no problems running millions of threads.



FYI, sparks are different from threads. Haskell has "forkIO" threads which are comparable to Erlang processes/go-routines (actually, they're cheaper than both since haskell allocates less stack for threads). Threads are what you want for concurrent programming (i.e., non-deterministic interleaving of behaviour, which with GHC can be run in either single-threaded or multi-threaded mode).

Sparks are for deterministic parallelism, the idea behind sparks is that you create a pool of sparks, each of which represent a small, finite bit of work that can be done in parallel.

In general sparks will represent a finite, deterministic amount of work, whereas threads represent a (potentially) infinite amount of non-deterministic work.


For anyone looking for an example, I suggest Chapter 24 of Real World Haskell [1]. The parallel stuff is about halfway down.

[1] http://book.realworldhaskell.org/read/concurrent-and-multico...


Also worth looking at "Parallel and Concurrent Programming in Haskell" http://chimera.labs.oreilly.com/books/1230000000929


Probably one of the best books on the topics (parallelism, concurrency, distributed programming) overall in addition to being a great Haskell resource.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: