[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: another try at multithreading
- From: "Robert Raschke" <rtrlists@...>
- Date: Fri, 20 Jun 2008 18:23:27 +0100
On 6/19/08, Javier Guerra <javier@guerrag.com> wrote:
> this is a recurring theme in my thoughts: how to do (efficient)
> multitasking on Lua... with full data sharing between threads? I
> really don't like the several-spaces solutions (LuaLanes, LuaTask,
> etc), because there's no nice and clean to pass complex data (like
> deep tables, closures, coroutines, etc) around at will.
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.
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.
Just my 2 cents worth,
Robby