lua-users home
lua-l archive

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


I recently discovered the nice "Exploring Lua for Concurrent
Programming" paper.  (Yes, I'm a little behind.)  It briefly mentions
expanding the implementation outward to remote processes.  I'm
actually wondering about expanding the implementation inward, to
coroutines.  In other words, could there be a concurrency abstraction
across pure coroutines (cooperative multitasking within a Lua state),
preemptive multitasking between Lua states, and remote processes
(whether another OS process on local machine or remote via network)?

Why would that be interesting?  My assumption is that coroutines are
significantly lighter weight than Lua states.  With a concurrency
abstraction encompassing coroutines, the application designer doesn't
have to decide about pure coroutines vs. real threads vs. distributed
computing up front--  the same software building blocks will work as
efficiently as possible in each of the modes.  As the system scales
you'd think about locality of messaging-- first level would be
coroutines within a Lua state, next Lua states within an OS process,
then OS processes within a machine (could help isolation, not
performance), and finally machines within a network.

I haven't thought much yet about whether an implementation is feasible
or how the luaproc API would change.