2 ms·
Whatever the cost in C, Haskell is incurring the same cost, unless it is using green threads. (You could use green threads in C - or something similar, though
by raverbashing 7y ago
Whatever the cost in C, Haskell is incurring the same cost, unless it is using green threads.
(You could use green threads in C - or something similar, though to be honest counting words in a file is a bit of an annoying problem for parallelism)
- pcstl 7y agoHaskell does use green threads. The thing is, Haskell code is managed by a Haskell runtime, and each runtime manages a single (processor) thread. So the usual parallelism model for Haskell is to spawn a runtime for each processor core and then let each runtime manage its own green threads.