lua-users home
lua-l archive

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


On Fri, Mar 30, 2012 at 9:45 AM, Valerio Schiavoni
<valerio.schiavoni@gmail.com> wrote:
> Are there other ways to exploit multicores ?

This is definitely multi-threaded week on lua-l!  The idea of
coroutines transparently running on other cores reminds me of the
'goroutine' concept from Go, where the scheduler puts coroutines onto
their own thread if they block, etc.  And then to use some mechanism
like channels (the Go term) or lanes (the Lanes term) to do
communication.  So the goal of a _transparent upgrade_ seems
idealistic.

There's always the old standby, spawning worker processes - I'd
imagine that mostly you want to offload some time-consuming
calculation to another core.   The equipment needed is simply some
function like spawn(cmd,callback) which you can 'fire and forget' and
afterwards pick up the results when the process finishes.

Reading the final output of such a process can be clumsy, but if it's
in the form of a Lua table then you already have a very fast parser
available.

steve d.