lua-users home
lua-l archive

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


On Fri, Jun 20, 2008 at 12:23 PM, Robert Raschke
<rtrlists@googlemail.com> wrote:
> Programming efficient multithreaded applications requires a different
> mindset from good old fashioned sequential apps. In particular "full
> data sharing between threads" to me signifies an app doomed to fail
> (i.e., hard to write and maintain). If you need to share "complex
> data" you have not partitioned your problem correctly for a parallel
> solution.
>
> To get an indication on what "real" parallel apps can look like have a
> read across some of the apps written in Erlang.

AFAIK, Erlang allows passing "compex data" between threads, for
example closures as part of the messages coming and going.  that's not
possible with current "separate spaces" solutions in Lua.

> I think about the verbs in my problem space as providing hints for
> parallization. The stuff that gets worked on on limits the
> parallelism, that´s your data! The more you are thinking in terms of
> data, the less you will spot any chance for parallelism and the more
> you will become obsessed with getting your locks right.

in Lua, if you can't pass around closures, coroutines, tables
(efficiently), then the interface isn't transparent enough.

what i'm aiming is not a programming framework or endorsing a
paradigm, it's a foundation to make these possible.  (if fact, maybe
not even that, just reopening the discussion, with some real (even if
crude) code on the table).

remember, even Erlang with its nice lightweight threads and message
passing, is implemented on top of shared data structures.

(Off topic, i do my share of "real" parallell apps, some CPU-bound on
multiple cores, some for big storage on clusters, just that i want
more of that on Lua, and not just C(++) with a little Lua sprinkled
over)

-- 
Javier