lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

* 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.