[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Visualising comparative programming language performance
- From: Florian Weimer <fw@...>
- Date: Tue, 02 Jun 2009 21:58:00 +0200
* gary ng:
> While we are talking about language, it seems that erlang and
> K/Q(from KDB+) have an interesting approach about parallelism. You
> can kind of just specify the number of threads(usually matching the
> number of cores) on launching the session and let the runtime
> determine how to parallize them.
I don't think Erlang works that way. You still have to create a
suitable number of processes (Erlang's lightweight threads). Too many
of them, and you'll hit performance issues, too few of them, and some
of the cores remain idle. Erlang's execution model is based on an m:n
mapping of processes to OS threads, but this is not unusual.
(Although some pthreads implementations have moved away from it to a
simpler 1:1 model.)
The GHC might have something magical in a few years. Laziness might
allow you to generate just enough work to keep your cores busy.